mirror of
https://github.com/kalarina-bit/Sparkledns.git
synced 2026-11-22 07:36:09 +00:00
Benchmark: warm the emulator up first and run three rounds by default
Two identical APKs differed by 9% in median cold start without it.
This commit is contained in:
@@ -176,6 +176,16 @@ measure() {
|
||||
echo "::endgroup::"
|
||||
}
|
||||
|
||||
# The first launches after boot are far slower than later ones; warm up before measuring
|
||||
echo "::group::warm-up"
|
||||
install "$BASE_APK"
|
||||
for _ in 1 2 3 4 5; do
|
||||
adb shell am force-stop "$PKG"
|
||||
launch >/dev/null
|
||||
sleep 2
|
||||
done
|
||||
echo "::endgroup::"
|
||||
|
||||
for r in $(seq "$ROUNDS"); do
|
||||
if (( r % 2 )); then
|
||||
measure base "$BASE_APK"
|
||||
|
||||
Reference in New Issue
Block a user