Not able to determine time taken by Dart VM initialisation
- Ngôn ngữ chính
- Dart
- Star
- 1.7k
- Fork
- 404
- Merge trung bình
- 6 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 18
Mô tả
I am tracing app startup for Android device (Samsung Galaxy m51), In flutter devtools, I can see Warm-up frame at 4s 52ms 432us.
I am trying to analyse this delay and therefore need to find time taken by Dart VM initialisation as I am suspecting that could be one culprit.
In logs I can see a gap of 3.107s in MainActivity OnResume to main.dart first statement execution.
In Dev tools I can see gap of 4.52s before Warm-up frame and our own code execution.
I also added custom timeline traces in main.dart first line itself, its starting at ~4s
I am trying to verify if both are pointing to same delay.
As per my understanding Dart VM startup is somewhere between this time.
In another run I tried with '--trace-startup --profile'
in the startuptimeline.json i got :
{
"name": "DartVMInitializer",
"cat": "Embedder",
"tid": 4139,
"pid": 4139,
"ts": 14740213596,
"ph": "E",
"args": {}
},
this seems to be an end event but there is no subsequent start event in that file.
In dev tools I am not able to see much between FlutterEngineMainEnter and Warm-up frame.
Flutter doctor :
Flutter doctor results :
[✓] Flutter (Channel stable, 3.13.4, on macOS 14.0 23A344 darwin-arm64, locale en-IN)
• Flutter version 3.13.4 on channel stable at /Users/hrishikeshrajwade/Downloads/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 367f9ea16b (2 months ago), 2023-09-12 23:27:53 -0500
• Engine revision 9064459a8b
• Dart version 3.1.2
• DevTools version 2.25.0
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at /Users/hrishikeshrajwade/Library/Android/sdk
• Platform android-33, build-tools 32.1.0-rc1
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15A507
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.1)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 73.0.4
• Dart plugin version 231.8109.91
[✓] VS Code (version 1.71.2)
• VS Code at /Users/hrishikeshrajwade/Downloads/Visual Studio Code.app/Contents
• Flutter extension version 3.60.0
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện startup trace của Android với --trace-startup --profile và kiểm tra startuptimeline.json xung quanh FlutterEngineMainEnter, DartVMInitializer và warm-up frame. So sánh timeline với các sự kiện được DevTools hiển thị và xác định xem sự kiện bắt đầu DartVMInitializer bị thiếu hay khoảng thời gian chưa được instrument có giải thích được khoảng trống được báo cáo hay không. Công việc được xem là hoàn tất khi có thể xác định khoảng thời gian khởi tạo hoặc tài liệu hóa rõ ràng phần instrumentation bị thiếu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- dart
- Lĩnh vực
- observability, performance
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 20/100