Skip to content

JsInliner re-traverses whole function bodies once per call site #10394

Description

@rhuanhianc

JsInliner.containsNestedFunctions traverses a function's entire body, and is called once per candidate call site through
isInlinable → isVolatile → affectedBySideEffects ,on every inliner pass.

The predicate is a pure function of the body, so the work is redundant. On two large applications (122 and 231 split points), JFR sampling with full stack depth attributes ~79% of all JsInliner time to this single predicate; JsInliner itself is 28.7% of the permutation's CPU and 36–48% of total compile time.

Memoizing it takes JsInliner from 57.9s to 10.5s and from 328.5s to 22.8s on those two applications, with byte-identical output.

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