Hacker News new | ask | show | jobs
by razorsese 4696 days ago
Why is this faster?

https://gist.github.com/jdpaton/9f20ff0b13e0cc20017a

1 comments

I did find this bit:

  // When calling .end(buffer) right away, this triggers a "hot path"
  // optimization in http.js, to avoid an extra write call.
  //
  // However, the overhead of copying a large buffer is higher than
  // the overhead of an extra write() call, so the hot path was not
  // always as hot as it could be.
  //
  // Verify that our assumptions are valid.
https://github.com/joyent/node/blob/master/benchmark/http/en...