watt
watt copied to clipboard
Debug info is compiled in
trafficstars
More than half of the (uncompressed) .wasm file of wa-serde-derive is made up of the debug info section.
$ cp serde_derive.wasm serde_derive_nodebug.wasm
$ wasm-strip serde_derive_nodebug.wasm
$ du -h *
1,1M serde_derive_nodebug.wasm
2,8M serde_derive.wasm
$ gzip serde_derive*
$ du -h *
232K serde_derive_nodebug.wasm.gz
688K serde_derive.wasm.gz
So it turns out, against my expectations, that the badly compressing part is actually the debug info while the code itself compresses pretty well. So removing debuginfo would greatly reduce the download size of the wa-serde-derive crate.
See https://github.com/serde-rs/serde/pull/1650 where I do some further tricks to get the compressed size down even further.