Skip to content

CodeSplitter's not-exclusive CFA computation is quadratic in fragment count #10395

Description

@rhuanhianc

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions