-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Limit zlib concurrency #15301
Comments
This doesn’t seem unreasonable to me. 👍 |
Would you have any tips on where to get started? It's simple enough to implement some JS-based queuing such that only so many streams are created concurrently (keep a counter, push to a backlog, intercept callbacks and pop, etc) - but is there a more elegant way anyone would suggest? |
@STRML I don’t think this can be applied to zlib streams in general – you can have a 100 zlib streams and only a few of them processing data at any given time without running into trouble. I’d say this only applies to the one-shot async method like With that in mind, yes, your suggestion seems like a perfectly fine approach – Let me know if you need any help. |
Unfortunately, the way that I believe the issue needs to be farther down the stack, to where |
Put into https://github.com/nodejs/node/projects/13 backlog |
Related to #8871 (comment) and websockets/ws#1202.
In the benchmarks in ws#1202 on both Linux and Mac platforms we've been able to reproduce a consistent performance benefit when limiting
zlib.deflate()
concurrency:Running with reduced concurrency not only takes less time, it allocates far less memory and avoids the fragmentation issue altogether.
Moving to a new allocator to avoid the fragmentation issue would not only be error-prone, it still would not fix the performance issue.
Is there any interest in implementing a queueing mechanism for limiting concurrency on calls to
zlib
to take advantage of the above benefits without pushing the burden downstream?The text was updated successfully, but these errors were encountered: