Skip to content

Layout times differ between DevTools and Instruments #104656

@gaaclarke

Description

@gaaclarke

Description

The timeline events for LAYOUT differ from the time spent in PipelineOwner.flushLayout. In the case of the default flutter project, for the first frame, the timeline event says LAYOUT takes 78.9ms, but when running the same app through Instruments, PipelineOwner.flushLayout is reported to be 13ms. The LAYOUT event is generated inside of PipelineOwner.flushLayout so they should be equivalent. I suspect this may be a difference between cpu time and clock time? When the difference is so dramatic it seems like that distinction should be visible in DevTools somehow. It also seems to be a problem that the cpu time and the clock time are so dramatically different, that indicates the UI thread is being preempted a lot at startup.

LAYOUT:
Screen Shot 2022-05-25 at 2 16 02 PM

Instruments:
Screen Shot 2022-05-25 at 2 18 24 PM

Steps to reproduce

  1. flutter create counter
  2. cd counter
  3. flutter run --profile
  4. connect to DevTools and look at the LAYOUT event
  5. open ios/Runner.xcworkspace
  6. 'Product -> Profile`
  7. Use the CPU profiler in Instruments
  8. Run the app
  9. Search in Instruments for the flushLayout symbol.

cc @kenzieschmoll for DevTools visibility cc @dnfield for performance consideration

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: devtoolsDevTools related - suite of performance and debugging toolsperf: speedPerformance issues related to (mostly rendering) speed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions