Skip to content

Commit bcd2617

Browse files
authored
changes
1 parent 1924bd3 commit bcd2617

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

_posts/2018-07-02-how-to-reduce-cold-startup-time-101.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
layout: post
3-
title: Warming Up The Cold Start: How To Reduce Cold Startup Time 101
3+
title: Warming Up The Cold Start: How To Reduce Cold Startup Time Of Your Android App
44
---
55

66
Have you ever had your patience tested by apps that cheekily keep flashing their logos at you for a moment too long, while you just cannot wait to order food or book a cab or pay the cab driver and rush to work? If that sounds like you, you too have been a victim of poor **cold startup time**, and unless you want your app to add to that growing pool of the digitally downtrodden, read on!
77

8-
#### Cold start? Enlighten me, please!
8+
#### Cold Start? Enlighten me, please!
99
Cold start refers to an app starting from a scratch, that is the time taken from the moment the code is initialised till the UI is responsive to the user. It happens in cases such as your app is being launched for the first time since the device booted, or since the system killed the app. Needless to say, the lesser the cold startup time, the better the user experience.
1010

1111
Android developers provides a comprehensive explanation of app startup time [here](https://developer.android.com/topic/performance/vitals/launch-time).
@@ -28,14 +28,18 @@ To check how your Android app is performing in comparison to other apps, go to *
2828

2929
In Android 4.4 and higher, logcat includes an output line containing a value called **"Displayed"**. This value represents the amount of time elapsed between launching the process and finishing drawing the corresponding activity on the screen. The reported log line looks similar to the following example:
3030

31-
**ActivityManager: Displayed com.android.app/.StartupTiming: +3s534ms**
31+
```
32+
ActivityManager: Displayed com.android.app/.StartupTiming: +3s534ms
33+
```
3234

3335
P.S. if you are tracking the time in Android studio, make sure you disable filters in your logcat view because it is the system server, and not the app, that serves this log.
3436

3537

36-
Don't be confused if the "Displayed" line in the logcat output contains an additional field for "total" time. For example:
38+
Don't be confused if the "Displayed" line in the logcat output contains an additional field for **total** time. For example:
3739

38-
**ActivityManager: Displayed com.android.gradeup/.StartupTiming: +3s534ms (total +1m22s643ms)**
40+
```
41+
ActivityManager: Displayed com.android.gradeup/.StartupTiming: +3s534ms (total +1m22s643ms)
42+
```
3943

4044
Here, the first time measurement is only for the activity that was first drawn and the "total" time measurement begins at the app process start, and could include another activity that was started first but did not display anything to the screen (for example a splash screen). This extra measurement is shown when there is a difference between the single activity and total startup times.
4145

0 commit comments

Comments
 (0)