playground icon indicating copy to clipboard operation
playground copied to clipboard

Suggestion: strip ZLS WASM binary to reduce total page size

Open ianprime0509 opened this issue 2 years ago • 0 comments

Something I realized while playing around with this project is that the ZLS WASM binary is currently the largest part of the total content transferred over the network (it's 11.22MB with the version of the page currently deployed, and with the latest Zig it's closer to 12MB). For comparison, the latest Zig master (with the appropriate patch) compiled to WASM using ReleaseSmall is 5.3MB.

Attempting to compile ZLS to WASM using ReleaseSmall unfortunately does not work due to https://github.com/ziglang/zig/issues/15469 (the reproducer I provided in the comments of that issue was reduced from ZLS). However, using wasm-strip from https://github.com/WebAssembly/wabt, it is possible to bring the 12MB ReleaseFast build of ZLS down to 2.2MB (just by removing all the custom sections).

ianprime0509 avatar Aug 24 '23 02:08 ianprime0509