A few of us have started an effort to reduce startup time on Android devices. This is a critical aspect of Firefox’s user experience. More often than not, Firefox is killed in the background as you are using your Android device. When you then find an interesting link on Twitter or need to look at the weather, you are presented with the lovely Firefox logo for several seconds while we get ready to show the UI and load your web page. Multiply this flow by a few times a day, and you’ll feel some pain as you impatiently wait for Firefox.
Then, imagine tapping on a link and immediately seeing a familiar interface that is loading your web page in place of a loading screen. This is the goal for startup shrink.
It’s been a week since our first meeting. Some important bugs:
- Near term
- Bug 616057: Rebuild NDK5 with PIC. PIC stands for position independent code. If we generate non-PIC, the runtime linker must go through the binary code and replace code locations. Owner: bear
- Bug 668838: Implement improved flow for language choice. This means Firefox will normally only load one locale and hyphenation file during startup. Owner: wesj
- Bug 673253: Delay sqlite usage until first paint. Improve perceived performance by painting earlier. Owner: me
- Bug 673262: Gold linking on Android. Gold is a smarter linker than ld, and can typically generate smaller binaries. And, using LTO, gold can remove even more code. Owner: glandium
- Long term
- Bug 632954: Enable PGO for Android. Using PGO, we can figure what code needs to run at startup and what code runs later and reorder the binary appropriately. Later, we can even generate two different libraries that separate hot startup code from the rest. Owner: glandium
As usual, measuring startup time is generally very tricky. Using wall clock time for a warm startup doesn’t accurately represent real world scenarios. Here are some bugs that might help us with instrumentation:
- Bug 675233: Show when components are initialized. Useful for the bigger picture. This is wall clock time, so it’s important to try to swap out Fennec before starting it up. There are steps in the bug.
- Bug 673258: I/O data for startup using systemtap. No progress to report here.
- Bug 674986: Build profiler for Android devices. This is about getting a custom ROM that includes useful kernel modules, like oprofile and perf.
If you have ideas for improving startup time or ideas for tools, get in touch! Better yet, maybe you’d like to contribute some code. We can be found in #startup on irc.mozilla.org.