To make an Android app start faster, the main idea is to do less during startup. In practice, we usually reach for:
- Asynchronous Loading
- Delayed Loading (DelayLoad)
- Lazy Loading
If you have worked on startup optimization, you have probably used these already. Here I want to look at one DelayLoad implementation and why it behaves as it does. The code is simple, but following it takes us through Looper, Handler, MessageQueue, and VSYNC. I’ll also discuss the problems I ran into and some thoughts along the way.