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

4.x seems to be significantly slower (not related to brotli!) #116

Closed
indeyets opened this issue Jun 17, 2020 · 4 comments
Closed

4.x seems to be significantly slower (not related to brotli!) #116

indeyets opened this issue Jun 17, 2020 · 4 comments

Comments

@indeyets
Copy link

I see that my app works with much higher CPU load and produces 20% throughput at the same time.

3.1.0 with no options: fast (119MB/s)
4.0.0 / 4.0.1 with no options: slow (20 MB/s)
4.0.x with { br: false }: slow
4.0.x with { br: false, gzip: false, deflate: false }: fast again

same machine, same nodejs version (12.16.3)

3.1.0 produces compressed output (I checked)

trying to trace it further

@indeyets
Copy link
Author

@uhop can it be related to the new "external" checks of Accept: headers?

@uhop
Copy link
Contributor

uhop commented Jun 17, 2020

4.0.0 was based on my ideas, but not on my code. I have to look first and compare versions.

In general, I would assume that any checks are fast, and, probably, done just once, and all CPU time is spent compressing. Could it be that gzip is running with a higher compression rate by default than in 3.1.0? One way to see it is to compare sizes produced by different versions.

I'll investigate.

@indeyets
Copy link
Author

indeyets commented Jun 17, 2020

Could it be that gzip is running with a higher compression rate by default than in 3.1.0

I doubt it is, as default invocation is without any options both in old and in new code. Will try to run another round of tests a bit later

@indeyets
Copy link
Author

ok. I guess it is related to #112

benchmark tool does not request compressed responses by default, but it gets one now.

I'll make separate investigation about why it hurts my production installation so hard.

I will close this issue, but #112 should be fixed

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

2 participants