You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In emscripten-core/emscripten#21426 we are discussing ways to improve on Base64 encoding of binary WebAssembly Modules embedded inside .js code. It is observed that both gzip and brotli compress Base64 pessimistically.
One observation here is that the UTF-8 standard is well-specified, so we can attempt to embed bytes directly as UTF-8 code points.
Attempting to do so runs into a Closure minification problem however.
This code nicely prints out all bytes from 0x00 up to 0xFF.
Input file is 689 bytes in size. However, running this file through Closure compiler Advanced Optimizations produces a file that is 1225 bytes in size: ab_closured.zip
Activity
[-]Closure minification adds \uxxxx espaces into output file, increasing code size[/-][+]Closure minification adds \uxxxx escapes into output file, increasing code size[/+]lauraharker commentedon Mar 5, 2024
The compiler defaults to outputting ASCII, but you can specify a different output charset via the
--charsetflag. (https://github.com/google/closure-compiler/wiki/Flags-and-Options#miscellaneous).Does
--charset=UTF-8work for you?juj commentedon Mar 6, 2024
Thanks, yeah, that works!
Fix Closure invocation.
Fix Closure invocation.
Fix Closure invocation.