Wait for target package MessageQueue empty before continuing
By using Looper.myQueue().addIdleHandler(), the variance for perf tests decreases dramatically. Before: registeredBroadcast_mean=12162588 registeredBroadcast_median=9496511 registeredBroadcast_stddev=10821157 manifestBroadcastRunning_mean=16673251 manifestBroadcastRunning_median=11859325 manifestBroadcastRunning_stddev=13329366 manifestBroadcastNotRunning_mean=59187569 manifestBroadcastNotRunning_median=55761932 manifestBroadcastNotRunning_stddev=14805616 Now: registeredBroadcast_mean=940791 registeredBroadcast_median=889583 registeredBroadcast_stddev=157170 manifestBroadcastRunning_mean=1396281 manifestBroadcastRunning_median=1364531 manifestBroadcastRunning_stddev=189226 manifestBroadcastNotRunning_mean=59161472 manifestBroadcastNotRunning_median=56538781 manifestBroadcastNotRunning_stddev=14414728 Test: m ActivityManagerPerfTestsTestApp ActivityManagerPerfTests Test: adb install \ $OUT/data/app/ActivityManagerPerfTestsTestApp/ActivityManagerPerfTestsTestApp.apk Test: adb install \ $OUT/data/app/ActivityManagerPerfTests/ActivityManagerPerfTests.apk Test: adb shell am instrument -w com.android.frameworks.perftests.amtests/android.support.test.runner.AndroidJUnitRunner Change-Id: I05714294c53f3d013a080dfaa617e1fc92fd14e0
Loading
Please register or sign in to comment