Skip to content

lz4 compressed wasm with -s SINGLE_FILE=1 #16056

Open
@ekpyron

Description

@ekpyron

It would be cool, if emscripten provided the option to compress a wasm binary with LZ4 before base64-encoding and embedding it via -s SINGLE_FILE=1.

Context: The solidity compiler https://github.com/ethereum/solidity has been publishing js/wasm binaries built with -s SINGLE_FILE=1 for a while now. However, the binaries have grown to over 20MB in size and require a lot of bandwidth and long loading times. We realized that lz4 compressing the wasm binary before base64 encoding will reduce the size to ~8MB and loading times actually become faster, since base64 decoding is slow in comparison.
So we're working on doing this manually, but we were wondering, if this may be something that's generally useful and may be a nice feature in emscripten itself. (Especially since we realized that you support something very similar with LZ4 = 1 already, just not applied to the embedded wasm binary)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions