Startup Time & App Size
Shrink cold start time and download size with lazy loading, code shrinking, asset optimisation and platform tools like baseline profiles.
Advanced · about 4 hours · difficulty 4/5
Learn first: Performance & Profiling
First impressions happen before your first screen draws. Slow cold starts and large downloads both cost installs and retention, especially on budget Android phones and metered data.
Kinds of start
- Cold start: the process is not running; the OS loads the binary, runtime and your initial code. This is the one to optimise.
- Warm and hot start: the process or activity already exists, so resuming is faster.
Speeding up startup
- Do as little as possible before the first frame: defer analytics setup, remote config and non-critical SDKs until after the first screen renders.
- Keep the splash screen honest; hide it once real content (or a skeleton) is ready, not after an arbitrary timer.
- React Native: Hermes precompiles JS to bytecode; lazy-load heavy screens and avoid large synchronous imports at the root.
- Android: Baseline Profiles tell ART which code to precompile, often cutting startup noticeably. Measure with Macrobenchmark.
- iOS: reduce dynamic frameworks and work in
initand app launch; measure with the App Launch instrument. - Flutter: defer heavy initialisation and consider deferred components on Android.
Reducing app size
- Ship Android App Bundles so Play delivers only the code and resources a device needs; iOS does similar app thinning.
- Enable R8 shrinking and resource shrinking on Android.
- Compress images (WebP, AVIF), use vector icons, and download large optional assets on demand.
- Audit dependencies; one convenience library can add megabytes.
Good enough to move on: you can measure cold start and install size for your app, name the three biggest contributors, and reduce at least one of them.
Key concepts
- Cold, warm and hot start
- Deferring non-critical initialisation
- Splash screen best practices
- Hermes bytecode: React Native
- Baseline Profiles: Android
- App Bundles and app thinning
- R8 and resource shrinking: Android
- Asset and dependency audits
Mini project
Measure the cold start of your app on a real device, move two SDK initialisations to after first render, compress assets, and report the start time and size change.
Check yourself
Which work in your app's launch path could safely wait until after the first screen is visible?
Free resources
- Android: App startup time (Android Developers)
- Android: Reduce your app size (Android Developers)
- React Native: Using Hermes (React Native)