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

Use xz compression instead of gzip to further shrink tarballs? #2

Open
HenrikBengtsson opened this issue Sep 21, 2023 · 1 comment
Open
Labels
reprex needs a minimal reproducible example

Comments

@HenrikBengtsson
Copy link

HenrikBengtsson commented Sep 21, 2023

install.packages() supports other types of compressions than gzip, including xz. By serving tar.xz instead of tar.gz/tgz package files, I think you could shave off ~10% of the file sizes.

For example, https://repo.r-wasm.org/bin/emscripten/contrib/4.3/digest_0.6.32.1.tgz is 131,292 bytes whereas the xz version is 116,132 bytes.

@georgestagg
Copy link
Member

georgestagg commented Sep 25, 2023

This is a nice idea in principle, but I think there is a cost to be paid in the time it takes to decompress the data inside the Wasm runtime. I am beginning to suspect R's decompression routines lead to a non-trivial amount of time spent during package installation in webR.

In the coming weeks I plan to experiment with delivering packages in the form of Emscripten file_packager images. IIUC these images are not compressed by default (though they can be), but in principle a modern web server and browser are able to negotiate compression over the wire in any case, using more efficient schemes such as Brotli.

I believe letting the browser handle over-the-wire compression natively, rather than decompression in Wasm, might improve package installation performance enough to bear the cost of larger package images on disk.

@georgestagg georgestagg transferred this issue from r-wasm/webr-repo Nov 6, 2023
@georgestagg georgestagg added reprex needs a minimal reproducible example and removed question labels Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reprex needs a minimal reproducible example
Projects
None yet
Development

No branches or pull requests

2 participants