Using Ayzim as a drop-in replacement for the Emscripten asm.js native optimizer when compiling an asm.js project of moderate or large size on `-O2` or `-O3` should result in a ~50-75% reduction in memory usage and a ~25-50% speedup when running asm.js native optimizer passes (i.e. most of the "js opts" stage as seen in in EMCC_DEBUG output).
To get it, download the compiled releases for Linux and Windows from the ayzim releases page <https://github.com/aidanhs/ayzim/releases>, extract them and replace (after backing up!) the existing optimizer(.exe) binary in `emsdk/emscripten/incoming_optimizer_64bit/` (if you're not on `incoming` but still feel brave, take a look at your emscripten config file, usually at `$HOME/.emscripten`, which should point you to the right place). -- Some background: when I was trying to port a large application to asm.js about 6 months ago I had serious problems with the Emscripten asm.js optimizer - it would split the 750MB .js file into chunks and promptly consume all 8GB of my RAM by trying to optimize the chunks in parallel, swapping everything else out of memory and grinding the machine to a halt. I tackled this problem by taking a brief(!) diversion to rewrite the optimizer in Rust to be more memory efficient. Along the way I added a few speedups. Ayzim is probably an entry in the "well this might have been useful two years ago" section of software (since asm.js is 'shortly' going to be made redundant by wasm) but someone may find a use for it. For example, people wanting to understand the structure of the Emscripten optimizer ast may want to look at this code <https://github.com/aidanhs/ayzim/blob/0.1.2/src/cashew.rs#L141> and/or ask me since I'm very familiar with it now :) In time I may extend Ayzim to support wasm optimizations and move it to being more of a library, but that's for the future. Aidan -- 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]. For more options, visit https://groups.google.com/d/optout.
