Description
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)