Hermes: The JS Engine for Faster React Native Apps
Hermes is a JavaScript engine optimized for React Native that prioritizes fast startup and low memory use. It's the default for new apps, pre-compiling JS to bytecode at build time. The footgun: don't just check a global variable; benchmark release builds.
WHY IT EXISTS Mobile apps need to start fast and use memory efficiently. Traditional JavaScript engines, often designed for browsers, can have overhead that isn't ideal for a mobile environment where resources are more constrained. Hermes was created to solve this startup performance problem specifically for React Native.
THE MENTAL MODEL Think of Hermes as a pre-compiler for your JavaScript. Instead of shipping raw JS code and having the user's device parse and compile it on first run, Hermes does that heavy lifting ahead of time, during your app's build process. The app ships with optimized bytecode, leading to a much faster "time to interactive."
HOW IT WORKS Hermes is an Ahead-Of-Time (AOT) focused engine. When you create a release build of your React Native app, the build tools use Hermes to compile your JavaScript source code into a compact, efficient bytecode format. The Hermes virtual machine running on the user's device is then purpose-built to execute this specific bytecode very quickly. This reduces the work the device has to do at startup, improving performance.
WHEN TO USE IT You should use Hermes in almost all modern React Native projects. It is the default for new apps for a reason. Its benefits—improved start-up time, decreased memory usage, and smaller app size—are critical for a good user experience, especially on lower-end devices. Since it's bundled with React Native, it ensures compatibility out of the box.
WHEN NOT TO USE IT Disabling Hermes is rare. You might consider switching back to the alternative, JavaScriptCore, if your app relies on a specific, niche JS feature that Hermes doesn't support, or if you encounter a rare, engine-specific bug. This should be a deliberate choice backed by profiling data, not a default decision.
ONE CANONICAL EXAMPLE A user opens your app. With a traditional engine, the device might spend precious milliseconds parsing and compiling a large JS bundle. With Hermes, the app loads a pre-compiled bytecode bundle. This can shave significant time off the initial load. To verify this, you must build a release version (e.g., yarn android --mode release) and measure the startup time against a non-Hermes build. Checking for the global.HermesInternal variable is not enough to confirm you're getting the performance gains.
Read the original → reactnative.dev
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.