Startup‑time regression after enabling Hermes in a React‑Native app
The situation Say you are a lead mobile engineer on a two‑month sprint for a consumer‑facing React‑Native app (React‑Native 0.73). The product team has pushed a deadline to ship version 2.1, and the QA team reports that the app now takes ≈ 1.8 s to reach the first screen on a mid‑range Android 11 device (Pixel 5). The same build, but with the default JavaScript engine (JSC) enabled, consistently…
After implementing a tutorial that enabled Hermes for a React Native app on Android 11 devices, a regression was discovered causing a delay of approximately 0.6 seconds in app startup time. This regression had three consequences: a decrease in user conversion, additional debugging and potential rollback needed for release schedule, and required a post-mortem meeting to address team concerns.
The cause of the regression was the loading overhead of Hermes's bytecode, which increased the disk read latency on devices with limited I/O bandwidth. Additionally, the AOT compilation approach used by Hermes produced a single large bytecode file that needed to be mapped into memory, further slowing down startup time on low-end devices.
Certain third-party modules also had compatibility issues with Hermes, leading to fallback paths that resulted in increased bundle parsing and inflated startup time. Enabling Hermes for debugging connected to a slower WebSocket handshake, which added extra delay before the app could proceed. Finally, the build-time cost of enabling Hermes added approximately 30% to the Android build time, reducing the frequency of releases and increasing the risk of stale dependencies.
By following a step-by-step process to reproduce the regression, revert to the default JavaScript engine (JSC), profile the engine load time, verify bytecode size and memory mapping, and consider mitigations such as splitting the bundle, developers can understand the impact of Hermes on startup time and decide whether to keep it enabled for specific releases.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.