This patch makes the dominatortree recalculate when applying updates with the size of the update vector larger than a threshold. Directly applying updates is usually slower than recalculating the whole domtree in this case. This patch fixes an issue which causes JT running slowly on some inputs.
In bug 37929, the dominator tree is trying to apply 19,000+ updates several times, which takes several minutes.
After this patch, the time used by DT.applyUpdates:
Input | Before (s) | After (s) | Speedup |
the 2nd Reproducer in 37929 | 297 | 0.15 | 1980x |
clang-5.0.0.0.bc | 9.7 | 4.3 | 2.26x |
clang-5.0.0.4.bc | 11.6 | 2.6 | 4.46x |
I think this comment is still too vague. It doesn't need to be altered until the final algorithm is selected but I'd like to see more details here. Seemingly arbitrary constants needs support information more than "trust me, I ran some tests".