-
Notifications
You must be signed in to change notification settings - Fork 523
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 to compress cache entries #784
Conversation
I feel like this has been discussed before, but you might look at using .tar.zstd if you're going to make this change, since that would allow compression across entries where zip compresses one entry at a time. |
I thought about doing this, but this change was much simpler; a quick run over my sccache cache corpus (a bunch of Firefox builds, ~8GB of zip files) says that |
I don't think it would be worth for compression size, but it could be worth for latency: with the zip format, you have to have downloaded the entire thing before you can start decompressing. With tar, you can stream the decompression. With things ordered in the right way, you wouldn't even need to keep everything in memory. |
(OTOH, the overhead of decompressing is so low...) |
I can totally get behind this. At the same time, making cache entries tar files would be somewhat more complicated than this, and then to take advantage of being able to stream decompress the cache entries would require significant rewriting of the storage layer (though I see from poking around that our GCS/S3/Azure support have basically copy-paste'd code for converting network requests into in-memory Experiments have also suggested that hiding the network latency here is not worth it...yet. I do like the idea of |
The potential benefits of using bazel's cache format (
|
0d48109
to
935ac84
Compare
zstd is faster and gives slightly smaller (~5%) compressed blobs than deflate does, as measured on a Firefox build. Rather than inventing our own compressed archive format, we piggyback on top of zip's "stored" files to stuff zstd-compressed blobs in the zip archive.
935ac84
to
12cf679
Compare
zstd is faster and gives slightly smaller (~5%) compressed blobs than
deflate does, as measured on a Firefox build. Rather than inventing our
own compressed archive format, we piggyback on top of zip's "stored"
files to stuff zstd-compressed blobs in the zip archive.