Start target package by binding to Service, not starting Activity
This reduces the stddev for a bunch of perf tests by quite a bit (mostly the ones that rely on starting the package). This is because previously the target package was made to start running by starting an Activity, which takes up CPU cycles. Now we start a Service and wait for it to report back that its Looper queue is idle, then proceed. This does seem to slightly increase the runtime for some of the tests though... Some test numbers (only tests that have a large difference before and after): Before: registeredBroadcast_mean=1920309 registeredBroadcast_median=1724844 registeredBroadcast_stddev=559809 manifestBroadcastRunning_mean=2395693 manifestBroadcastRunning_median=2063385 manifestBroadcastRunning_stddev=809836 contentProviderRunning_mean=668463 contentProviderRunning_median=588125 contentProviderRunning_stddev=214116 bindServiceAllowOomManagement_mean=1952431 bindServiceAllowOomManagement_median=2017682 bindServiceAllowOomManagement_stddev=289311 bindServiceAlreadyBound_mean=2146257 bindServiceAlreadyBound_median=2022891 bindServiceAlreadyBound_stddev=614549 bindServiceRunning_mean=4947541 bindServiceRunning_median=4710521 bindServiceRunning_stddev=962094 startServiceProcessRunningReadUriPermission_mean=1914106 startServiceProcessRunningReadUriPermission_median=1915209 startServiceProcessRunningReadUriPermission_stddev=196136 startServiceProcessRunning_mean=2841122 startServiceProcessRunning_median=2564792 startServiceProcessRunning_stddev=684654 After: registeredBroadcast_mean=2559587 registeredBroadcast_median=2579792 registeredBroadcast_stddev=191377 manifestBroadcastRunning_mean=2709707 manifestBroadcastRunning_median=2725365 manifestBroadcastRunning_stddev=165661 contentProviderRunning_mean=663058 contentProviderRunning_median=639062 contentProviderRunning_stddev=97864 bindServiceAllowOomManagement_mean=1899179 bindServiceAllowOomManagement_median=1932553 bindServiceAllowOomManagement_stddev=184329 bindServiceAlreadyBound_mean=2023920 bindServiceAlreadyBound_median=2051614 bindServiceAlreadyBound_stddev=159993 bindServiceRunning_mean=6683975 bindServiceRunning_median=6753699 bindServiceRunning_stddev=475811 startServiceProcessRunningReadUriPermission_mean=2388997 startServiceProcessRunningReadUriPermission_median=2405365 startServiceProcessRunningReadUriPermission_stddev=244184 startServiceProcessRunning_mean=3384101 startServiceProcessRunning_median=3388282 startServiceProcessRunning_stddev=207333 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 BUG: 67460485 Change-Id: Iaaaf7d8db885cc1149e74cb7ce4b47a295ab20e4
Loading
Please register or sign in to comment