Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tune android system resource scheduler for performance measurement #16

Open
ailzhang opened this issue Apr 13, 2022 · 5 comments
Open

Comments

@ailzhang
Copy link
Contributor

ailzhang commented Apr 13, 2022

While we developed Android AOT demo for v1.0 release we noticed an interesting (or confusing) behavior in our demo app. It runs super fast upon startup, and then slows down possibly due to Android "smart" resource management marking it as a non resource-intensive application and somehow limit how much resource is allocated to our app. A "simple" proof of concept we found is that the app runs dramatically faster if we swipe up from bottom of the screen to force entering the overview mode.

To demonstrate the speed difference described above, we run the app on a Redmi K40 where the speed gap is more visible. Please see the gifs listed below, notice the fps stabilized at 20fps at startup (the first gif) and jumped to 50fps and stabilized at 30fps in the end (the second).

Any insights or ideas about how to fix the speed gap are highly appreciated!
cc: @k-ye @turbo0628 @bobcao3

--
Team Android (v1.0 limited edition), Taichi Graphics

@keith2018
Copy link

keith2018 commented Apr 16, 2022

Try measure the cpu/gpu frequency and cpu temperature with tools (e.g PefDlog ), some kind of Android devices will automatically lower the cpu frequency when cpu temperature exceeds certain threshold to reduce energy consumption (or meet other specific conditions), and recover it while there is user interaction,

you can simulate user interaction using adb command tap frequently to see if the cpu frequency recovered

adb shell input tap 200 200

The energy saving strategy of Android devices may complicated depends on different manufacturers, some manufacturers will provide white list to apps, see Hardcoder

@eatcosmos
Copy link

is there debug environment to Recurrence this problem?

@ailzhang
Copy link
Contributor Author

@keith2018 I've tried tapping but it didn't help hmmm. Gonna give pefdlog a try and see if there's anything suspicious.
@eatcosmos hmmm nope it also happens in the release build of the app :(

@eatcosmos
Copy link

@keith2018 I've tried tapping but it didn't help hmmm. Gonna give pefdlog a try and see if there's anything suspicious. @eatcosmos hmmm nope it also happens in the release build of the app :(

hi how can i get the same images phenomenon above, in real phone or emulator?
image

@ailzhang
Copy link
Contributor Author

@eatcosmos Yea you can download the app from https://github.com/taichi-dev/taichi/releases/download/v1.0.0/TaichiAOT.apk and installing it on a android10+ can reproduce this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants