-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] add explainer for Android CPU profiling. #48407
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,55 @@ | ||||||
|
|
||||||
| # Android CPU Profiling | ||||||
|
|
||||||
| Android devices have different performance characteristics than iOS devices, and I've found that CPU traces frequently reveal surprising performance issues, such as https://github.com/flutter/engine/pull/48303 . This document describes the steps to capture an equivalent [flame graph](https://cacm.acm.org/magazines/2016/6/202665-the-flame-graph/abstract) on your local Android device. | ||||||
|
|
||||||
|
|
||||||
| 1. Build Local Engine with Symbols | ||||||
|
|
||||||
| Add the `--no-stripped` flag to the gn config when building the android engine. | ||||||
|
|
||||||
| Example config: | ||||||
|
|
||||||
| `gn --no-lto --no-goma --runtime-mode=profile --android --android-cpu=arm64 --no-stripped` | ||||||
|
|
||||||
|
|
||||||
| 2. Configure Gradle to not remove strip sources | ||||||
|
|
||||||
| In the flutter project file android/app/build.gradle, add the following line under the android block: | ||||||
|
||||||
| In the flutter project file android/app/build.gradle, add the following line under the android block: | |
| In the flutter project file `android/app/build.gradle`, add the following line under the `android` block: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 3. `flutter run` the app with the local engine flags. | |
| 3. `flutter run` the app with the local engine flags (`--local-engine`, `--local-engine-host`, `--local-engine-src-path`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| You can create a new blank project if you don't have one already. You do not need to open the application project nor do you need to run the App through Android Studio. In fact, its much easier if you do not do those things. | |
| You can create a new blank project if you don't have one already. You do not need to open the application project nor do you need to run the App through Android Studio. In fact, it's much easier if you do not do those things. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scratch "I've found that", as it's reviewed/in our repo it doesn't need an "I found".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done