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
Use Zstd instead of gzip for compression #552
Comments
FWIW, icecream uses lzo which is also a lot faster. |
Isn't that just because |
I'm not sure how the performance of miniz_oxide compares to zlib, but even zlib is appreciably slower than Zstd. |
Currently cache entries are just zip files. It wouldn't be hard to change that, all the code for creating and unpacking cache entries is in this file: You'd need a container format of some sort since there can be multiple output files + stdout/stderr, but it should be straightforward to use tar files. |
Oh, it strikes me that since you're using Toolchain: Lines 146 to 159 in d309339
Inputs packaging: Line 1246 in 0cb2e77
Inputs unpackaging: Line 980 in d309339
Outputs are handled here: Lines 424 to 446 in d309339
Unfortunately if you change this you'll either need to support both compression formats for interop or change the whole dist API to a v2. |
Related, while looking at that code I realized that at least for Rust compilation packaging compile inputs is probably doing a lot of redundant work so I filed this issue on a potential optimization: #558 |
A clobber build that solely distributes compiles to a remote does appear to spend a significant amount of time in the local I guess we could modify zip-rs to support zstd for individual data entries in the zip file? It's unmaintained, which I guess would be a good thing for something like this. I don't know that I'd feel comfortable hard-coding some constant in zip entries to be zstd, so we'd have to figure out how to plumb that down into the guts of |
I should note that these measurements were taken on a binary that changed input compression to be done with zstd...but I'll also note that changing I think I'll try putting together a patch that enables native zlib at the very least; I think that should go in regardless. We'll see how things look and whether zstd compression should be enabled for the inputs. |
This is just one of a few things to try related to mozilla#552. As a first step it would be interesting to see what kind of impact this has on Firefox automation builds. Some initial measurements are promising for builds with lots of cache misses, but this sort of thing is cumbersome to measure, so I'd like to try enabling this for the sccache client built in Mozilla automation to see the impact it has there.
This is just one of a few things to try related to #552. As a first step it would be interesting to see what kind of impact this has on Firefox automation builds. Some initial measurements are promising for builds with lots of cache misses, but this sort of thing is cumbersome to measure, so I'd like to try enabling this for the sccache client built in Mozilla automation to see the impact it has there.
I think this issue can be closed now that #784 is merged. |
Thanks |
We're currently spending an appreciable amount of cpu time doing zlib compression:
Using Zstd should give better compression and better performance.
The text was updated successfully, but these errors were encountered: