Skip to content
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

ENH: Offer zstd encoding for pareto superior compression #738

Closed
corneliusroemer opened this issue Apr 17, 2024 · 3 comments · Fixed by #739
Closed

ENH: Offer zstd encoding for pareto superior compression #738

corneliusroemer opened this issue Apr 17, 2024 · 3 comments · Fixed by #739
Assignees

Comments

@corneliusroemer
Copy link
Contributor

corneliusroemer commented Apr 17, 2024

Recently, zstd has become supported in Chromium alongside br, gzip and deflate as a supported compression method.

It might be worth looking into using it for on the fly compression for LAPIS as that's exactly the domain where zstd is absolutely amazing: fast compression on server side, good compression ratios, fast decompression in browser.

I had that idea when I noticed you use gzip for the many requests for covSpectrum:
image

image

https://caniuse.com/mdn-http_headers_content-encoding_zstd

@fengelniederhammer fengelniederhammer transferred this issue from GenSpectrum/LAPIS-SILO Apr 17, 2024
@fengelniederhammer
Copy link
Contributor

If at all, this should be implemented in LAPIS, so I transferred the issue.

@fengelniederhammer
Copy link
Contributor

Actually this is more or less implemented, we should simply prefer zstd over gzip: #739

Note that this doesn't guarantee that CoV-Spectrum gets zstd compressed data, because this is part of the content negotiation and proxies play their part in that game. It might be that our proxies apply their own compression. Locally, without a proxy, Chrome got zstd compressed data.
image

@corneliusroemer
Copy link
Contributor Author

I did a quick test including/excluding gzip from the content-encoding accept header using requestly and these are the results (caching disabled):

Zstd:
image

Gzip:
image

Note that zstd is slightly less efficient in compressing, but server responses are faster. I wonder if zstd compression strength can be increased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants