devtools icon indicating copy to clipboard operation
devtools copied to clipboard

Performance page slow to load on Linux

Open aam opened this issue 2 years ago • 9 comments

Dev tools peformance tab takes over 10 seconds to load, compared to just 2 seconds for observatory

launch-performance-tab-devtools.webm

observatory-timeline-launch.webm

This is on a simple dart app:

$ cat i1.dart
main() {
  Future.delayed(Duration(seconds :5), () { print('elapsed'); });

launched like

$ out/ReleaseX64/dart  --observe:8080 --disable-service-auth-codes --timeline_streams=all --timeline-recorder=endless --serve-observatory i1.dart

Devtools app launched separately, connected to this dart app paused.

aam avatar Nov 10 '23 18:11 aam

@kenzieschmoll

polina-c avatar Nov 17 '23 15:11 polina-c

@jakemac53 this might be a good one to tackle next while you are looking at performance.

kenzieschmoll avatar Feb 14 '25 18:02 kenzieschmoll

It looks to me like this is resolved now - I did notice however that if the app is paused, we will hang forever on this page (with a working spinner).

Most of the time seems to be spent inside of base64.decode today and we can't really fix that, but it is already being split up into a lot of small chunks of work.

jakemac53 avatar Feb 14 '25 20:02 jakemac53

Here is what I see using the same example app today:

https://github.com/user-attachments/assets/f226191e-54d4-4139-bd7d-a1042e3a0ab9

jakemac53 avatar Feb 14 '25 20:02 jakemac53

It looks to me like this is resolved now - I did notice however that if the app is paused, we will hang forever on this page (with a working spinner).

@bkonyi is it expected that the VM service calls for the performance page (getPerfettoVmTimeline, listening to events on the Extension stream, etc.) would hang for a paused app?

kenzieschmoll avatar Feb 18 '25 16:02 kenzieschmoll

https://github.com/flutter/devtools/pull/9162 fixes the hang issue @jakemac53 described here.

@aam do you have a reliable repro for the slow load? I followed your repro steps above but opening the performance page loads quickly for me. I am on a Mac. From your SDK path it looks like you may be using Linux?

foo.dart

cat foo.dart 
main() {
  Future.delayed(Duration(seconds :5), () { print('elapsed'); });
}%      
xcodebuild/ReleaseARM64/dart --observe:8080 --disable-service-auth-codes --timeline_streams=all --timeline-recorder=endless --serve-observatory foo.dart

Open the printed DevTools URL --> navigate to the performance page --> page loads quickly.

kenzieschmoll avatar May 01 '25 18:05 kenzieschmoll

do you have a reliable repro for the slow load? I

Yes, simple dart --observe hello.dart on my machine consistently takes few seconds from opening the browser with the link before browser page is populated with some content. Observatory on the other land is loaded immediately.

aam avatar May 01 '25 20:05 aam

@aam What machine do you have? I'm wondering if this is due to OS or architecture differences. AFAIK @jakemac53, @bkonyi, and I are all using MacOS and none of us can reproduce.

kenzieschmoll avatar May 01 '25 21:05 kenzieschmoll

@aam What machine do you have? I'm wondering if this is due to OS or architecture differences.

it's a glinux.

aam avatar May 01 '25 21:05 aam