My legacy holo app used to start up very fast.
Recently, I spend 1 year part-time, to port the holo app, to material designed app. Here's some significant changes which I had done.
- From API 21 to API 23
- From
ActionBarSherlock
toAppCompat
Toolbar support library - From support library v4:22.1.1 to v4:23.2.1
- Final compiled APK size changed from 4~5 MB to 5~6 MB.
One of the problem I'm facing right now is slow startup speed of my material designed app. It is significant slower (more than 2 seconds) than my holo designed app.
Fast start up speed for holo app
Slow start up speed for material designed app
Note, before launching the app, I had ensure I kill the process (By going Settings -> App -> Force Stop) upfront.
As you can see from the video, once I tap on the icon, the ActionBar
for the holo app is immediately shown. Where as, for material designed app, you need to wait around 2 to 3 seconds, only the Toolbar
will become visible.
At first, I want to use TraceView
to debug and root cause of the slowness. However, I realize TraceView
can only be used on the app which is already started.
I had confirmed I don't perform any time consuming task in my Application
, Activity
and Fragment
. Since both of my holo app & material designed app share the same logic code, I can't figure out the reason why my material designed app is slower.
Have anyone of you face the same problem? I was wondering, is there any good way for me to track down the root cause?