Skip to content

FAST HTTP YEAH

Depends on: https://github.com/nodejs/node/pull/2351

I just want to kick off the discussion of where this path may lead us. With this change http Server will consume all data from the net.Socket, skipping its data events, and the server will parse this data directly without going to JS-land and without allocating Buffer instances.

From my local benchmarks (simple server, GET requests):

  • Performance is 20% better with empty body on GET requests
  • 10% better with 16kb body, still on GET requests

I'm yet to run our benchmarks on some server (or my laptop) to see what general effects this patch has on everything, but I think it should be mostly an improvement, not degradation.

The downside of this thing is absence of data events on the net.Socket. We will also need to handle the cases where the socket is not a net.Socket instance after all, which might appear in user-land modules.

Please leave your feedback here.

cc @bnoordhuis @trevnorris @nodejs/collaborators

Merge request reports

Loading