binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

[wasm-split] Slow splitting many modules

Open biggs0125 opened this issue 5 months ago • 1 comments

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)].

biggs0125 avatar Jul 15 '25 17:07 biggs0125

cc @aheejin

tlively avatar Jul 15 '25 18:07 tlively

#7956 reduced the splitting time of a Dart test case that splits a module into 350 submodules by around 66%.

aheejin avatar Dec 12 '25 21:12 aheejin