Hermes · JavaScript engine

On this page 7

Hermes is an open-source JavaScript engine developed by Meta and optimized for running React Native apps on Android and iOS. In mobile performance work, Hermes matters because it moves parsing and compilation from the phone to the build machine, shipping precompiled bytecode that starts faster and occupies less memory than source code interpreted at launch.

Hermes has been the default engine since React Native 0.70, replacing JavaScriptCore as the standard choice. Not to be confused with unrelated software projects that share the name.

How the Hermes engine executes JavaScript

Hermes executes JavaScript through ahead-of-time compilation to bytecode: during the app build, the Hermes compiler parses the JavaScript bundle, optimizes it and emits a compact Hermes bytecode file. At runtime the engine maps this file into memory and interprets it directly, so the device never spends time parsing source text on launch.

The design deliberately omits a just-in-time compiler. A JIT can make long-running code faster, but it costs memory for compiled machine code, adds warm-up time and is restricted on iOS for third-party engines. Hermes trades peak throughput for predictable startup and lower memory, a sensible exchange for interactive mobile apps where most code runs briefly.

The table below shows the main stages and where each one happens.

StageWhere it runsEffect on the device
Parsing and compilationBuild machineNo parse cost at launch
Bytecode optimizationBuild machineSmaller, faster instruction stream
Bytecode loadingDevice, memory-mappedPages load lazily as needed
InterpretationDeviceSteady performance without warm-up
Garbage collectionDevice, mostly concurrentShorter pauses on the UI thread
Where Hermes does its work

Performance effects on startup, memory and size

The clearest benefit of Hermes is shorter time to interactive, the interval between tapping the icon and being able to use the first screen. Because bytecode is ready to run and loaded on demand, apps with large bundles typically see noticeably faster cold starts, with the largest gains on low-end Android devices.

Memory use falls because the engine avoids holding both source text and JIT output, and because its Hades garbage collector performs most work concurrently with JavaScript execution. Reported improvements vary widely with bundle size and device class, so teams should measure on their own app rather than rely on published figures.

MetricUsual directionWhat drives it
Cold start timeLowerNo parsing, lazy bytecode loading
Memory footprintLowerNo JIT code cache, compact heap
Download sizeOften lowerSmaller native library; bytecode may be larger than minified text
GC pause lengthLowerConcurrent Hades collector
Long compute loopsSometimes slowerInterpretation without JIT
Typical direction of change after switching to Hermes

Hermes compared with other JavaScript engines

Hermes occupies a different niche from browser engines, which are tuned for long sessions and heavy computation. The comparison below shows why React Native chose a specialized engine as its default.

EngineCompilation modelTypical strength
HermesAhead-of-time bytecode, interpreterFast startup and low memory
JavaScriptCoreInterpreter plus JIT tiers where allowedMature, system engine on iOS
V8Interpreter plus optimizing JITHigh peak throughput
Static HermesNative code from typed JavaScriptNear-native speed for typed modules
Hermes and other engines used with React Native

Static Hermes is an experimental evolution that can compile type-annotated code to native machine code. Its maturity and integration timeline remain uncertain, so production apps should treat it as an option to evaluate, not a guaranteed upgrade.

Adopting and profiling Hermes in a React Native app

In current React Native templates, Hermes is enabled by default, and older projects can turn it on through the hermesEnabled property in Gradle and the hermes_enabled option in the iOS Podfile. After switching, teams should rebuild native code completely and confirm the engine by checking global.HermesInternal at runtime.

  • Profile with the Hermes sampling profiler and inspect traces in Chrome DevTools or Perfetto.
  • Measure cold start on a low-end device, since gains are largest where CPU and storage are slow.
  • Upload source maps to crash analytics so bytecode stack traces map back to readable code.
  • Audit unsupported features such as with statements and certain locale behaviors before release.

The following table links common symptoms to likely causes when Hermes adoption does not go smoothly.

SymptomLikely causeTypical fix
Unreadable crash stacksMissing bytecode source mapsCompose and upload Hermes source maps
Slower heavy computationNo JIT for hot loopsMove work to native modules or workers
Date or Intl differencesEngine-specific locale supportTest formatting on target locales
Startup gain smaller than expectedNative initialization dominatesProfile native startup separately
Troubleshooting Hermes adoption

Limitations and trade-offs

The main limitation is lower peak performance for CPU-heavy JavaScript, such as image processing or large data transformations, where a JIT engine would optimize hot paths. Hermes also implements most but not all of recent ECMAScript, so libraries relying on rare features may need polyfills or alternatives.

Finally, Hermes speeds up only the JavaScript part of startup. Native module initialization, large images and network requests on the first screen remain separate bottlenecks, which is why Hermes works best combined with lazy loading and careful bundle design.

Debugging also changes. Because the shipped artifact is bytecode, readable stack traces depend on correct source maps, and a broken build step can leave production crash reports nearly useless. Teams that adopt Hermes should therefore treat source map generation and upload as a required release step, verified in continuous integration before every store submission, rather than an optional convenience added after the first incident.

Put simply

Many phone apps are written partly in JavaScript, a language the phone must translate before it can run it. Normally that translation happens every time the app opens. Hermes does the translation in advance, on the developer’s computer.

It is like receiving a book already translated instead of a dictionary and the original text. The phone can start reading right away. As a result, apps open faster and use less memory, especially on cheaper phones.

In practice

A team behind a React Native grocery delivery app noticed in Android vitals that cold starts on budget phones often exceeded four seconds. The app still used JavaScriptCore and shipped a JavaScript bundle of about 6 MB.

After upgrading React Native and enabling Hermes, the developers rebuilt both platforms, uploaded Hermes source maps to their crash reporting tool and measured startup on a two-year-old entry-level phone. Cold start time dropped by roughly a third, and peak memory on the home screen fell as well.

One screen that sorted thousands of products in JavaScript became slightly slower, so the team moved that sorting to the server. The release shipped with faster launches across the device range and no new crash categories.