devtools icon indicating copy to clipboard operation
devtools copied to clipboard

Layout and Build times don't add up

Open jacob314 opened this issue 3 years ago • 2 comments

Here the frame took 160ms but build+layout is over 300ms. Looking at the timeline, It seems like the value for build is calculated incorrectly or the two times can overlap due to cascading builds and layouts and we need to factor that into the UI to not double count.

Screen Shot 2022-09-23 at 9 02 19 AM Screen Shot 2022-09-23 at 9 03 01 AM

Repro json file. dart_devtools_2022-09-23_09:03:04.681.json.txt

jacob314 avatar Sep 23 '22 16:09 jacob314

We don't do any calculating for the times in the flutter frames chart. We pull these times directly from the 'Flutter.Frame' events. So if the timeline events and the Flutter.Frame events show drastically different build times, I would think the time calculation in the Framework is incorrect (@goderbauer @iskakaushik)

kenzieschmoll avatar Sep 26 '22 20:09 kenzieschmoll

Does the code in question here use a LayoutBuilder or a lazy list? Both nest build phases within the layout phase. So, you can't just add build and layout times to get the total frame time.

goderbauer avatar Sep 26 '22 21:09 goderbauer