binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

Optimize Asyncify to not flatten unnecessarily

Open kripken opened this issue 3 years ago • 0 comments

We could only flatten when we see we actually need to instrument a function. If most functions don't need instrumentation then it would avoid most of the build time overhead (but it just saves build work - it would not help runtime). In general that's not the case - indirect calls in a big project tend to mean everything needs instrumentation - but when it is true it could be a nice speedup.

To do this we'd need to refactor the pass quite a bit, though, to not just run the Flatten pass and the others immediately. We'd need to identify the functions, either by scanning them first or as we go. And we'd need to run all the followup passes only in the case that we do flatten.

kripken avatar Jul 22 '22 20:07 kripken