Performance: measure, then fix · senior
Startup time (TTI) and app size
Cold start = native init + loading the Hermes bytecode + running module code + first render + first data, so you measure each phase in release builds and cut it by deferring SDK setup, lazy-loading heavy modules and screens, shrinking the bundle, and keeping the splash only until critical data is ready.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- Phases: process start and native init (Application / AppDelegate, native SDKs) → JS bundle load (Hermes bytecode, no parsing) → module evaluation → first render → content ready (TTI).
- Measure cold starts only, in release builds: performance marks / PerformanceObserver (stable since 0.83) or react-native-performance, Android vitals, Sentry time-to-initial-display.
- Inline requires: a require runs only when first used. The React Native CLI template inlines require calls (not imports) automatically; Expo needs inlineRequires: true. Use React.lazy for big screens.
- Defer non-critical work (analytics, remote config, chat SDKs) until after the first render. Avoid big synchronous storage hydration at boot.
- Bundle size: analyse with source-map-explorer or Expo Atlas, avoid barrel imports, drop heavy libraries (moment, full lodash), rely on tree shaking.
- App size: ship an AAB (per-ABI and per-density splits), enable R8 (on by default in Expo SDK 58 release builds), compress assets to WebP, watch native SDK weight. RN 0.76 merged native libraries into one .so (−3.8 MB).
- An uncompressed Android bundle (0.79) lets Hermes memory-map it; Discord saw about 400 ms better TTI.
The red pen
Common traps: mistake → fix
Mistake: "Just enable Hermes"
Fix: it is already the default; you still have to cut startup work.
Mistake: "Measure startup in debug"
Fix: debug loads JS from Metro; the numbers mean nothing.
Mistake: "App size = JS bundle size"
Fix: native SDKs and assets are often much bigger.
Easy to hard
Questions interviewers ask, easy to hard
- The splash shows for 4 seconds on low-end Android. How do you find what is slow?
- What runs before your JS even starts?
- What would you lazy-load, and how?
- Our Android download is 85 MB. How do you cut it?
- How do you stop startup time from regressing?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.