watt icon indicating copy to clipboard operation
watt copied to clipboard

Debug info is compiled in

Open est31 opened this issue 6 years ago • 2 comments
trafficstars

More than half of the (uncompressed) .wasm file of wa-serde-derive is made up of the debug info section.

est31 avatar Oct 14 '19 18:10 est31

$ 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.

est31 avatar Oct 14 '19 19:10 est31

See https://github.com/serde-rs/serde/pull/1650 where I do some further tricks to get the compressed size down even further.

est31 avatar Oct 15 '19 13:10 est31