Skip to content

Surface cost of intrinsics calculations in traces #93031

Closed

Description

@goderbauer

IntrinsicHeight and IntrinsicWidth can be pretty expensive. In traces, this cost is currently only seen when debugProfileLayoutsEnabled is turned on. We should surfaces it in the traces even if that option is turned off.

/cc @dnfield
/cc @kenzieschmoll The cost of intrinsics may be another thing to highlight in janky frames.

Activity

  1. added
    a: devtoolsDevTools related - suite of performance and debugging tools
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Nov 3, 2021
  2. Hixie commented on Nov 3, 2021

    @Hixie
    Contributor

    Did you have in mind putting a Timeline event that covers the pre-child-layout part of the intrinsics layout?

  3. goderbauer commented on Nov 3, 2021

    @goderbauer
    MemberAuthor

    The easiest way to do this would be to just add tracing in the RenderObjects of IntrinsicHeight and IntrinsicWidth around the entry point into the intrinsics methods to track the part before laying out the actual child.

    A smarter way may be to start the trace the first time an intrinsics method is called and keep track of how deep we are inside the intrinsics callstack. When the last intrinsics method returns, we end the trace.

  4. Hixie commented on Nov 4, 2021

    @Hixie
    Contributor

    another option would be to add Timeline traces around the get*Intrinsic* methods, that would hit other use cases too, beyond the widgets. It would mean the overhead is higher though...

  5. self-assigned this
    on Nov 4, 2021
  6. 13 remaining items

  7. github-actions commented on Dec 24, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on Dec 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a: devtoolsDevTools related - suite of performance and debugging toolsframeworkflutter/packages/flutter repository. See also f: labels.waiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions