-
Notifications
You must be signed in to change notification settings - Fork 113
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
Reduce install/bundle size #175
Comments
It's entirely likely that we can drop the dependency on hdr-histogram in a new major release and depend directly on the createHistogram() function in Node.js. There are some API differences there, however, so I'll need to investigate. If it does look like that's possible, however, that will be a significant reduction. I'd also like to see if we can get eventemitter-asyncresource added to Node.js as an option. It's too much of a performance hit for us to make all |
Yea, dropping the hdr-histogram seems reasonable! And if you need help in the process, I'm happy to help! Thanks for the consideration! |
It'll take a while before we can rely on it being available in all supported versions, but nodejs/node#41246 merges one of the dependencies here into node.js core. |
That's a good change! Thanks for that! |
With Node.js 12 being EOL, we can drop hdr-histogram-js. Is that correct? |
This issue has been marked as stale because it has been opened 30 days without activity. Remove stale label or comment or this will be closed in 5 days. |
Not stale, I guess a lot has happened in the last years and this could now be reasonably achieved? |
Piscina became dependency-less since then I believe this can be closed if the goal was in that way. @Aslemammad what are your thoughts? |
Nice, looks like this happened semi recently: |
Thank you so much y'all for the effort, let's close this then! |
Hello folks, I'm the tinypool (the 25kb fork of piscina) creator, and we've been talking about how to reduce the piscina's install size on Twitter. I hope my findings benefit you!
Bundling & Minifying
In tinypool, I don't bundle any dependency since there's no dependency for tinypool, but it seems that we can remove some additional files (of piscina's dependencies by bundling them).
You can see those useless files included in the install size here.
https://unpkg.com/browse/eventemitter-asyncresource@1.0.0/ (src, test)
https://unpkg.com/browse/piscina@3.2.0/ (benchmark, src, test)
https://unpkg.com/browse/hdr-histogram-percentiles-obj@3.0.0/ (test)
https://unpkg.com/browse/hdr-histogram-js@2.0.1/ (test, src, benchmark, ...)
Removing dependencies
In tinypool, we remove eventemitter-asyncresource (copying its minimal content & dropping other files) & hdr-histogram since we didn't need the last one. Still, I guess piscina can't do that; utilization is one of the good features of piscina (in @vitest-dev we didn't need it).
But as it was mentioned in Twitter, node 14 already afford that for us, so I guess by dropping node 12, we can reduce a significant portion of the install size!
https://twitter.com/matteocollina/status/1471828739537391623
https://twitter.com/jasnell/status/1471831611108839425
Thanks to the Piscina team for reaching out & giving us the opportunity + to those who helped me maintain tinypool, @TrySound @vitest-dev
The text was updated successfully, but these errors were encountered: