Skip to content

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

Open

Description

@HenrikBengtsson

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.

Activity

  1. georgestagg commented on Sep 25, 2023

    @georgestagg
    Member

    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.

  2. added
    reprex
    and removed on Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    reprex

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions