Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 9a502bc52ed29a33ad007eacd261cc4cd0c50072
Author: Chris Craik <ccraik@google.com>
Date: Tue May 03 10:57:48 2022
Improve macrobench iter speed by optimizing shell commands
Fixes: 231323582
Fixes: 231323379
Test: ./gradlew bench:b-c:cC bench:b-m:cC
Test: TrivialStartupBenchmark
Test: ShellBehaviorTest#pgrep
* Switch from ps | grep -> pgrep, which is *much* faster (saves multiple seconds)
* Reduce polling duration when waiting on perfetto to finish (commonly saves 400ms)
* Add shell command tracing, to make costs more obvious
* Merge two `rm` commands in executeScript when stderr is used (saves 6ms)
3 iteration cold startup benchmark went from 22 -> 14 seconds.
Change-Id: I608ec35df876d3ad93e4ecc6df2c12fb4ed99b01
M benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoHelper.kt
M benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ShellBehaviorTest.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/Shell.kt
https://android-review.googlesource.com/2086023
Branch: androidx-main
commit 9a502bc52ed29a33ad007eacd261cc4cd0c50072
Author: Chris Craik <ccraik@google.com>
Date: Tue May 03 10:57:48 2022
Improve macrobench iter speed by optimizing shell commands
Fixes: 231323582
Fixes: 231323379
Test: ./gradlew bench:b-c:cC bench:b-m:cC
Test: TrivialStartupBenchmark
Test: ShellBehaviorTest#pgrep
* Switch from ps | grep -> pgrep, which is *much* faster (saves multiple seconds)
* Reduce polling duration when waiting on perfetto to finish (commonly saves 400ms)
* Add shell command tracing, to make costs more obvious
* Merge two `rm` commands in executeScript when stderr is used (saves 6ms)
3 iteration cold startup benchmark went from 22 -> 14 seconds.
Change-Id: I608ec35df876d3ad93e4ecc6df2c12fb4ed99b01
M benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoHelper.kt
M benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ShellBehaviorTest.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/Shell.kt
Description
Sample trace:https://ui.perfetto.dev/#!/?s=33fa111ddc4df0e7fc6ee0ad39010663e3ffed3ad4f09345e6a54a8fdc467
The executeCommand there ishttps://ui.perfetto.dev/#!/?s=33fa111ddc4df0e7fc6ee0ad39010663e3ffed3ad4f09345e6a54a8fdc467
ps -A | grep
, which is extremely slow. Sample trace using pgrep instead (which is available back to API 23):