0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/benchmark
Ben Noordhuis fda2b319dc http: save roundtrips, convert buffers to strings
This commit adds an optimization to the HTTP client that makes it
possible to:

* Pack the headers and the first chunk of the request body into a
  single write().

* Pack the chunk header and the chunk itself into a single write().

Because only one write() system call is issued instead of several,
the chances of data ending up in a single TCP packet are phenomenally
higher: the benchmark with `type=buf size=32` jumps from 50 req/s to
7,500 req/s, a 150-fold increase.

This commit removes the check from e4b716ef that pushes binary encoded
strings into the slow path. The commit log mentions that:

    We were assuming that any string can be concatenated safely to
    CRLF.  However, for hex, base64, or binary encoded writes, this
    is not the case, and results in sending the incorrect response.

For hex and base64 strings that's certainly true but binary strings
are 'das Ding an sich': string.length is the same before and after
decoding.

Fixes #5528.
2013-05-23 02:13:26 +02:00
..
arrays bench: Consistency in benchmark filenames 2013-02-19 17:16:55 -08:00
buffers bench: Consistency in benchmark filenames 2013-02-19 17:16:55 -08:00
crypto benchmark: hash stream 2013-05-14 11:36:04 -07:00
fs bench: Simplify duration arguments to benchmarks 2013-02-19 17:16:55 -08:00
http http: save roundtrips, convert buffers to strings 2013-05-23 02:13:26 +02:00
misc bench: add child process read perf benchmark 2013-03-25 13:16:07 +01:00
net bench: add dgram send/recv benchmark 2013-03-20 17:16:30 +01:00
tls bench: Simplify duration arguments to benchmarks 2013-02-19 17:16:55 -08:00
common.js bench: Add flag to be silent in runner 2013-03-05 14:23:01 -08:00
compare.js bench: compare binaries equal times 2013-03-20 20:25:48 +01:00
fs-write-stream-throughput.js fs: Change default WriteStream config, increase perf 2013-02-15 18:48:43 -08:00
http_bench.js bench: add continuous stress test 2012-04-27 23:11:32 +02:00
http_server_lag.js Typo in http_server_lag.js script 2012-03-06 19:31:16 -08:00
http_simple_auto.js bench: use res.end() for chunked encoding 2012-12-20 11:44:10 +01:00
http_simple_bench.sh bench: fetch port from env 2012-08-13 18:52:06 +02:00
http_simple_cluster.js bench: start a worker for each CPU 2012-05-25 00:35:10 +02:00
http_simple.js bench: Make http easier to profile 2013-02-25 17:47:28 -08:00
http_simple.rb
http-flamegraph.sh benchmark: Make flamegraphs a bit more useful 2012-12-29 15:32:26 -08:00
http.sh benchmark: Set port range properly on Linux 2012-12-29 15:32:26 -08:00
idle_clients.js
idle_server.js
io.c bench: Make io.c output easier to read 2013-02-19 14:14:37 -08:00
plot.R
report-startup-memory.js
static_http_server.js benchmark: Add resume() in static_http_server 2013-01-17 14:54:59 -08:00