Skip to content

WIP http_parser: don't reuse HTTPParser

As discussed in https://github.com/nodejs/diagnostics/issues/248 and https://github.com/nodejs/node/pull/21313, reusing HTTPParser resource is a blocker for landing require('async_hooks').currentAsyncResource(), since reusing an async resource interanlly would make it infeasible to use them reliably in WeakMaps. Two suggestions came up: have a wrapper around the HTTPParser which we would use as the async resource, or stop reusing HTTPParser in our HTTP server/client code.

This commit implements the latter, since we have a better GC now and reusing HTTPParser might make sense anymore. This also will avoid one extra JS->C++ call in some cases, which should improve performance for these cases.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Merge request reports

Loading