-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
repeated decompression slower after upgrading from node12 #43044
Comments
Thanks for the report. I would probably not qualify this as a bug. The garbage collector tries to strike a CPU/memory balance that's arguably right for most programs but not for the particular setup you picked ( The GC activates when the increase in external memory (the zlib buffers) exceeds a threshold that's relative to the size of the JS heap. The specifics don't matter too much but it's a heuristic to stop external memory from ballooning. Worth mentioning: V8 tweaked their heuristic based on feedback from us, that's why you see a difference after v12. Is this an issue for you or was it just a curiosity you noticed? |
Thanks for looking into it! It's fine by me to close this as working-as-intended.
Yes, unfortunately, my company is upgrading from 12->16 and ran into this issue. We noticed that this got significantly slower which slows down one of our important things by 3x. I confess that this is a weird thing to do so we probably deserve it. By chance, do you have ideas about how we can workaround it or a more specific indication of how it changed? |
Setting
|
Thanks, this was good advice. For the actual use case I was able to tune this so that it was only a 70% slowdown versus node12. Unfortunately that still wasn't acceptable. We ended up implementing the functionality we needed as a native addon, and just reused the relevant buffers in native-land. I am going to close this issue out now since it sounds like this is working-as-intended. |
Version
v16.15.0
Platform
Linux ip-172-33-6-102 5.11.0-1027-aws #30~20.04.1-Ubuntu SMP Thu Jan 13 11:46:53 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
repro.js
:How often does it reproduce? Is there a required condition?
No response
What is the expected behavior?
Performance should be similar to the node12 version and not 10x worse.
What do you see instead?
When I run with
--trace-gc
I see that there are several log lines that look like this referencing "external memory pressure" which don't happen with earlier versions:The low mutator utilization seems to indicate that this is a problem with the GC.
These log lines seem to take even longer as you increase the size of the heap (via changing
makeBigObject
), and the benchmark takes even longer.Additional information
No response
The text was updated successfully, but these errors were encountered: