Home Android Testing App Startup Efficiency. Testing launch efficiency could be… | by Chet...

Testing App Startup Efficiency. Testing launch efficiency could be… | by Chet Haase | Android Builders | Nov, 2020

[ad_1]

Testing launch efficiency could be difficult, however it doesn’t should be

Chet Haase
$ for i in `seq 1 100`
> do
> adb shell am force-stop com.android.samples.mytest
> sleep 1
> adb shell am start-activity -W -n com.android.samples.mytest/.MainActivity | grep "TotalTime" | minimize -d ' ' -f 2
> performed
ActivityTaskManager: Displayed com.android.samples.mytest/.MainActivity: +1s380ms
2020-11-18 15:44:02.171 1279-1336/system_process I/ActivityTaskManager: Absolutely drawn com.android.samples.mytest/.MainActivity: +2s384ms

Madness is doing the identical factor time and again and anticipating completely different outcomes.
– Albert Einstein

Madness is doing the identical factor solely as soon as and anticipating the outcomes to be definitive.

– Not Albert Einstein

$ adb shell am start-activity -W -n com.android.samples.mytest/.MainActivity
Beginning: Intent { cmp=com.android.samples.mytest/.MainActivity }
Standing: okay
LaunchState: COLD
Exercise: com.android.samples.mytest/.MainActivity
TotalTime: 1380
WaitTime: 1381
Full
ActivityTaskManager: Displayed com.android.samples.mytest/.MainActivity: +1s380ms
adb shell am start-activity -W -n com.android.samples.mytest/.MainActivity | grep "TotalTime" | minimize -d ' ' -f 2
$ [start-activity command as above...]
1380
adb shell am force-stop com.android.samples.mytest
$ for i in `seq 1 100`
> do
> adb shell am force-stop com.android.samples.mytest
> sleep 1
> adb shell am start-activity -W -n com.android.samples.mytest/.MainActivity | grep "TotalTime" | minimize -d ' ' -f 2
> performed
$ adb shell am start-activity -S -W -R 100-n com.android.samples.mytest/.MainActivity | grep "TotalTime" | minimize -d ' ' -f 2
classpath "androidx.benchmark:benchmark-gradle-plugin:1.0.0"
apply plugin: androidx.benchmark
$ ./gradlew lockClocks
Locked CPUs 4,5,6,7 to 1267200 / 2457600 KHz
Disabled CPUs 0,1,2,3
$ ./gradlew unlockClocks
$ for i in `seq 1 100`
> do
> adb shell am force-stop com.android.samples.mytest
> sleep 1
> adb shell am start-activity -W -n com.android.samples.mytest/.MainActivity | grep "TotalTime" | minimize -d ' ' -f 2
> performed

[ad_2]

Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Watch the Oppo Reno5 Professional 5G international unveiling dwell right here

Oppo is internet hosting an internet occasion, introducing the Reno5 Professional 5G smartphone in India. This can mark the worldwide arrival of the...

Poco F2 Will Not Use Snapdragon 732G SoC, Confirms India Head

        | Revealed: Monday, January 18, 2021, 9:57 ...

iMore Present 734: A Lotta MagSafe

Joe and Karen are joined by iMore's personal Luke Filipowicz for a chat about a number of the extra attention-grabbing CES bulletins for...