binaryen
binaryen copied to clipboard
[wasm-split] Slow splitting many modules
For a large file, wasm-split with --multi-split takes 3.5+ minutes to separate the file into ~350 submodules.
My understanding is that --multi-split basically invokes split mode iteratively. I imagine it would be faster if it processed the entire main module at once [O(n)] rather than walking the entire (albeit slowly shrinking) main module many times [O(n^2)].
cc @aheejin
#7956 reduced the splitting time of a Dart test case that splits a module into 350 submodules by around 66%.