Ah so it's a Binaryen thing, not clang's WASM backend. Good to know :) Thanks!
On Saturday, 20 June 2020 23:04:02 UTC+2, Thomas Lively wrote: > > WebAssembly itself doesn't have any compression in its data segments, but > Binaryen does split up data segments around ranges of zeroes as an > optimization. That transformation depends on the memory being initialized > to zero when it is created, making zeroes in data sections redundant. > > On Sat, Jun 20, 2020 at 1:42 PM Floh <[email protected] <javascript:>> > wrote: > >> I just noticed something interesting... through a stupid mistake on my >> part I accidentally added 4 MBytes of bloat to my native-compiled >> executables, because I statically initialized some innocent looking members >> of a very big global struct variable (so that this global struct only had a >> handful items initialized to non-zero values, but the remaining 4 MBytes >> were all zeros). >> >> Interestingly, the (uncompressed) WASM version *wasn't* 4 MByte, instead >> it was about the same size as if that massive global variable would be in >> the BSS segment (that's why I didn't notice the bloat in the native >> executables, I always check the size of the WASM output very carefully, but >> not for the native builds). >> >> So my question: Does WASM have some sort of simple compression for the >> data segment which kicks in for large chunks of zeroes? I tried to search >> the available WASM info, but couldn't find anything "obvious"... >> >> Thanks! >> -Floh. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "emscripten-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/emscripten-discuss/756dcbba-a40f-4f78-af79-74aa46df7625o%40googlegroups.com >> >> <https://groups.google.com/d/msgid/emscripten-discuss/756dcbba-a40f-4f78-af79-74aa46df7625o%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/1c468a48-908a-49de-b611-937965f071b6o%40googlegroups.com.
