Files
node-v0.x-archive/lib
Ben Noordhuis 5a19c07c08 http: pack response body buffer in first tcp packet
Apply the same optimization to res.end(buf) that is applied to res.end(str).

Speeds up `node benchmark/http_simple_auto -k -c 1 -n 25000 buffer/1`
(non-chunked response body) by about 750x. That's not a typo.

Chunked responses:

  $ cat tmp/http-chunked-client.js
  // Run `node benchmark/http_simple` in another terminal.
  var http = require('http'), url = require('url');
  var options = url.parse('http://127.0.0.1:8000/buffer/1/1');
  options.agent = new http.Agent({ maxSockets: 1 });
  for (var i = 0; i < 25000; ++i) http.get(options);

Before:

  $ time out/Release/node tmp/http-chunked-client.js
  real    16m40.411s
  user    0m9.184s
  sys     0m0.604s

After:

  $ time out/Release/node tmp/http-chunked-client.js
  real    0m5.386s
  user    0m2.768s
  sys     0m0.728s

That's still a 185x speed-up.

Fixes #4415.
2012-12-20 12:02:06 +01:00
..
2011-03-14 17:37:05 -07:00
2012-07-06 19:28:35 -07:00
2011-03-14 17:37:05 -07:00
2012-06-16 11:02:49 -07:00
2012-09-25 11:08:52 -07:00
2011-03-14 17:37:05 -07:00
2012-12-12 09:46:22 +01:00
2012-08-24 16:56:06 +02:00
2012-02-27 14:03:18 -08:00
2012-06-19 14:07:48 -07:00
2012-06-28 10:14:03 -07:00
2012-11-26 01:51:05 +01:00
2012-03-03 23:48:57 -08:00
2012-08-04 13:04:15 -07:00