tezvyn:

What is Hermes and its advantages over JSC?

AI-drafted, machine-checkedSource: interviewintermediate
WHAT IT TESTS

knowledge of the JS engine powering RN.

OUTLINE

Hermes is an open-source engine optimized for RN, with faster startup via precompiled bytecode and lower memory use.

RED FLAG

claiming Hermes JITs or always beats JSC at peak throughput.

WHAT THIS TESTS: Whether you understand the JavaScript runtime layer and the tradeoffs that drove React Native to adopt Hermes as the default engine on both platforms.

A GOOD ANSWER COVERS: Hermes is an open-source JavaScript engine built and optimized specifically for React Native. The two headline advantages are faster startup and lower memory consumption. Startup improves because Hermes precompiles JavaScript into Hermes bytecode at build time, so on device the app loads bytecode directly instead of parsing and compiling source at launch, which shrinks time-to-interactive. Memory improves because Hermes is ahead-of-time compiled with no JIT warmup, uses a compact bytecode format, and is tuned for the limited RAM of mid and low-end Android phones. A secondary benefit is smaller download size.

COMMON WRONG ANSWERS: Saying Hermes is faster because it has a JIT; it deliberately omits a JIT to save memory. Claiming Hermes always beats JSC in raw execution speed; for long, hot compute loops a JIT engine like JSC can pull ahead. Confusing Hermes with a transpiler or bundler.

LIKELY FOLLOW-UPS: How do you enable Hermes and verify it is running, what is the .hbc bytecode file, how does Hermes interact with the new architecture and JSI, and what debugging tooling changes when using Hermes.

ONE CONCRETE EXAMPLE: A content app that loaded a large JS bundle showed multi-second cold starts on budget Android devices under JSC. Switching to Hermes moved parsing off the critical path by shipping precompiled bytecode, dropping cold start noticeably and reducing peak memory, which cut out-of-memory crashes on 2GB-RAM phones even though microbenchmarks of tight arithmetic loops were roughly comparable.

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.