After many false starts, my wasm-isolate tool is finally working. You tell it which functions you want to preserve, and it will delete everything else that isn't required (directly or indirectly) to run them. This should allow me to strip large wasm modules with tons of required imports (like Photoshop here) down to just the bits required to run a hot function that we're working on the performance of - which should make it much easier to test optimizations and whatnot.

In this case, my tool can prune an 83MB binary file (over 900MB in the text format) down to just 173 bytes, and the module is still valid. (And most of those bytes are just the random custom section lurking in there.) It even got rid of the memory because there are no load or store instructions in this function.