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
Most passes run in under a second, except that in the first -O3:
ssa-nomerge takes 90s
precompute-propagate takes 104s
heap2local takes 55s
local-subtyping takes 56s
code-folding takes 77s
dae-optimizing takes 361s
optimize-stack-ir takes 36s
Overall, the first -O3 takes 836s. After that GUFA takes 31s and the second -O3 takes 410s. The -O1 takes 10s, spending most of its time in two executions of coalesce-locals that take 3s each.
Not easily, as we'd need to build an indexing for the LocalGet* etc. pointers.
But, meanwhile it seems the larger issue by far is that we can just skip param flowing entirely, as done in #6046.
A remaining issue is that the sheer number of locals in the function makes us slow nonetheless, but running -O1 first solves that. In theory perhaps -O3 should run those passes before the first LocalGraph-using pass, but that would add significant work that usually won't help, I worry.
We have made significant performance improvements since I filed this issue, and since I apparently decided I didn't need to attach the file in question, this is no longer actionable.
Activity
kripken commentedon Oct 23, 2023
code-foldingis odd as it doesn't use LocalGraph, but all the others do and are explained by that.This module has a function with over 100 K locals and over 300 K
local.gets, so LocalGraph has a lot of work to do.Possible optimization ideas:
-O1first removes all those locals, but leaves the param and thelocal.gets, and it is still slow.local.sets for the param lets us skip all the block flowing.unordered_map<Index, ..>which is apparently quite slow.tlively commentedon Oct 24, 2023
Can we replace the unordered_map with index keys with a simple array / vector?
kripken commentedon Oct 24, 2023
Not easily, as we'd need to build an indexing for the
LocalGet*etc. pointers.But, meanwhile it seems the larger issue by far is that we can just skip param flowing entirely, as done in #6046.
A remaining issue is that the sheer number of locals in the function makes us slow nonetheless, but running
-O1first solves that. In theory perhaps-O3should run those passes before the first LocalGraph-using pass, but that would add significant work that usually won't help, I worry.[NFC] LocalGraph: Move definition to logical place (#6045)
[NFC] LocalGraph: Optimize params with no sets (#6046)
[NFC] LocalGraph: Move definition to logical place (WebAssembly#6045)
[NFC] LocalGraph: Optimize params with no sets (WebAssembly#6046)
tlively commentedon Jan 11, 2025
We have made significant performance improvements since I filed this issue, and since I apparently decided I didn't need to attach the file in question, this is no longer actionable.