Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What accounts for the drastic superagent performance advantage over every other HTTP client? #1

Open
gajus opened this issue Nov 22, 2017 · 2 comments

Comments

@gajus
Copy link

gajus commented Nov 22, 2017

I am guessing you are familiar with the internals of these libraries (given your interest to create a benchmark).

It surprises me that superagent outperforms request/ got. What accounts for the drastic superagent performance advantage over every other HTTP client?

@fdesjardins
Copy link
Owner

No idea, I haven't had a chance to dive into the internals of all the libraries I've been testing. I was also surprised by superagent's performance over most of the other libs. They must have some trick, but I'm not sure what it is.

@yunnysunny
Copy link
Contributor

yunnysunny commented Sep 19, 2019

superagent set tcpNoDelay to true, I think it may take effect for performance.

https://github.com/visionmedia/superagent/blob/67a5eee7bc1c22a56b1bc5a5486488f8a5303c05/src/node/index.js#L768-L769

and it set agent to false, which will drop the support of keep-alive:

https://github.com/visionmedia/superagent/blob/67a5eee7bc1c22a56b1bc5a5486488f8a5303c05/src/node/index.js#L154

I have pulled a new request to check it : #5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants