1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

1008: larger POST_BUFFER_SIZE for CPU efficiency

Posting a 91762123-byte file to test/cgi/big_file.cgi.  The CPU
percentages are from "top" set up to update every 10 seconds and
checked near the end of the transfer, so they are less accurate
than the upload rate, which averages over the whole transfer.

buffer=4096: average 1.7 MiB/s, elinks 62% CPU, python 35% CPU.
buffer=8192: average 2.5 MiB/s, elinks 49% CPU, python 42% CPU.
buffer=16384: average 3.1 MiB/s, elinks 40% CPU, python 55% CPU.
buffer=32768: average 3.8 MiB/s, elinks 33% CPU, python 61% CPU.
buffer=65536: average 4.1 MiB/s, elinks 26% CPU, python 70% CPU.
buffer=131072: average 4.2 MiB/s, elinks 28% CPU, python 67% CPU.
buffer=262144: average 4.4 MiB/s, elinks 26% CPU, python 69% CPU.

I'm choosing 32768 as POST_BUFFER_SIZE because the advantages of
larger buffers don't seem very high and keeping this under 65536
may help anyone trying to port ELinks to DOS.

I'm using the same value for HTTP too, just to keep things consistent
until there is a reason to diverge.
This commit is contained in:
Kalle Olavi Niemitalo 2008-06-08 18:38:48 +03:00 committed by Kalle Olavi Niemitalo
parent 5839aa070a
commit d2da3f4967
2 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ close_pipe_and_read(struct socket *data_socket)
} }
#define POST_BUFFER_SIZE 4096 #define POST_BUFFER_SIZE 32768
static void static void
send_more_post_data(struct socket *socket) send_more_post_data(struct socket *socket)

View File

@ -592,7 +592,7 @@ accept_encoding_header(struct string *header)
#endif #endif
} }
#define POST_BUFFER_SIZE 4096 #define POST_BUFFER_SIZE 32768
#define BIG_READ 655360 #define BIG_READ 655360
static void static void