Skip to content

http: optimize outgoing requests#605

Closed
brendanashworth wants to merge 1 commit into
nodejs:v1.xfrom
brendanashworth:optimize-http-outgoing
Closed

http: optimize outgoing requests#605
brendanashworth wants to merge 1 commit into
nodejs:v1.xfrom
brendanashworth:optimize-http-outgoing

Conversation

@brendanashworth
Copy link
Copy Markdown
Contributor

This commit does some small optimization changes on
lib/_http_outgoing.js. These include switching from while loops to
for loops, moving away from util to typeof checks, and removing
dead code.

Here is a graph of the benchmark
change (duration = 20, ran twice each). Changes aren't very visible in
smaller packets - at 32 bytes, only about 1% more requests can be sent,
but it increases as the packets increase in size; 1024 has 4.7% more
throughput than before.

Here is a graph of the same
benchmark but sorted by encoding type. As it is shown, buffers get the
biggest speed increase, then utf-8, then ASCII.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

http Issues or PRs related to the http subsystem. performance Issues and PRs related to the performance of Node.js.

Projects

None yet

Development

Successfully merging this pull request may close these issues.