binaryen
binaryen copied to clipboard
Adding unsubtyping to O3
I experimented with adding the unsubtyping pass to the O3 pipeline. I tried inserting it in two places in the global pre-passes: before type-refining and before constant field propagation. The results of the experiment are below. The control is the current j2wasm build pipeline that explicitly runs unsubtyping multiple times. Those explicit passes are removed in the experimental runs. The timing data is from running a single -O3 locally on a very large j2wasm wat file and includes parsing time.
| size | O3 time | |
|---|---|---|
| control | 1 | 1 |
| both | 0.9989504951 | 1.407407407 |
| first | 0.9990367019 | 1.362962963 |
| second | 0.9990974859 | 1.237037037 |
I think that the results show that it would be enough to add unsubtyping in the second position (before cfp), but it would be worth trying to improve its performance first.