CodeSplitter.computeNotExclusiveCfaForFragments builds, for every exclusive fragment, a ControlFlowAnalyzer that traverses the run-asyncs of every other fragment — F² traversals.
With 122 split points that is ~15,000 traversals; with 231, ~53,000. On a real application the loop alone is 25.6% of the permutation's CPU, and CodeSplitter is 181s of an 11-minute compile.
The iterations are independent and can run in parallel: the CFA copy constructor deep-copies every mutable set and the traversal only reads the JProgram. Doing so takes CodeSplitter from 181.4s to 71.5s, with byte-identical output.
Note that-XfragmentCountdoes not help here — the merge strategy replaces the F² loop with an O(F) per-run-async CFA loop of roughly the same cost.
CodeSplitter.computeNotExclusiveCfaForFragmentsbuilds, for every exclusive fragment, aControlFlowAnalyzerthat traverses the run-asyncs of every other fragment — F² traversals.With 122 split points that is ~15,000 traversals; with 231, ~53,000. On a real application the loop alone is 25.6% of the permutation's CPU, and CodeSplitter is 181s of an 11-minute compile.
The iterations are independent and can run in parallel: the CFA copy constructor deep-copies every mutable set and the traversal only reads the JProgram. Doing so takes CodeSplitter from 181.4s to 71.5s, with byte-identical output.
Note that
-XfragmentCountdoes not help here — the merge strategy replaces the F² loop with an O(F) per-run-async CFA loop of roughly the same cost.