Skip to content

http: improve ClientRequest constructor

These PRs improve ClientRequest creation performance and tidy up a few other things.

Results with the included benchmark:

                                                    improvement significant      p.value
 http/create-clientrequest.js n=1000000 pathlen=1       19.66 %         *** 5.177002e-26
 http/create-clientrequest.js n=1000000 pathlen=128      6.25 %         *** 2.631094e-07
 http/create-clientrequest.js n=1000000 pathlen=16      17.25 %         *** 1.114277e-27
 http/create-clientrequest.js n=1000000 pathlen=32      15.81 %         *** 1.993393e-24
 http/create-clientrequest.js n=1000000 pathlen=64       6.67 %         *** 1.037841e-11
 http/create-clientrequest.js n=1000000 pathlen=8       16.12 %         *** 4.243041e-23

/cc @nodejs/http

CI: https://ci.nodejs.org/job/node-test-pull-request/5716/

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

Merge request reports

Loading