Startup Time

Startup Time and the New Architecture

Android reports how long an activity took to draw its first frame. Force-stopping the app before each launch makes every start cold, so the process, Hermes 11,328 and React Native 36,878 all start from nothing:

Measuring cold starts four timesJSX
for i in 1 2 3 4; do
  adb -s emulator-5554 shell am force-stop com.anonymous.booknest; sleep 3
  adb -s emulator-5554 shell am start -W -n com.anonymous.booknest/.MainActivity | grep TotalTime
  sleep 8
done
Cold-start times of BookNest on the emulator
Build TotalTime of four cold starts (ms)
Release: bytecode inside the APK 2238, 2220, 2392, 2676
Debug: JavaScript from Metro 3985, 4966, 4807, 4143

The release build started about twice as fast even on this loaded emulator; never judge startup from a debug build. Much of the remaining time is spent before the first screen: loading native libraries, creating the React 7,897 host, and running every module the entry file imports. The New Architecture helps here. Turbo Native Modules are initialized lazily, on first use, where the old bridge created most registered native modules at startup, and with the bridge gone (Bridgeless Mode) there is no message queue to set up. What remains is yours to trim: move work out of module scope (BookNest's root layout starts i18n, the query cache, SQLite 4,756 and a notification check before the first frame), defer non-urgent work until after the first screen has rendered, and remember that TotalTime stops at the first frame, not when the catalog's data arrives.