The speaker describes a typical JIT pipeline: parse JavaScript into bytecode, interpret it, then compile frequently used functions into machine code. Hot functions may receive further speculative optimization, with deoptimization if an assumption fails. These stages cost CPU and memory, and can leave multiple code versions in memory.
JIT JS engine pipeline vs Hermes pipeline
An unnamed Callstack speaker explains how Hermes shifts JavaScript compilation to build time, and why that suits React Native apps.
Hermes compiles source on the developer’s machine, optimizes an SSA intermediate representation, and produces a bytecode bundle for the device. At runtime, the executable is memory-mapped and run without a JIT. The speaker says this is a deliberate choice for the React Native workflow.
The speaker connects Hermes to React Native’s need for better time to interactive, especially on low-end devices. Facebook’s Marketplace tab was an example where slow initial loading and interactivity were a concern. Since React Native code is generally bundled with the app, its runtime environment is more controlled and its bytecode can be prepared ahead of time.
Browser JavaScript varies widely, so browser engines use multiple JIT tiers to handle diverse workloads. Node.js often runs repetitive work for longer periods on powerful machines, which can justify paying a warm-up cost for optimized code. React Native workloads are typically more ephemeral: most startup functions run zero or one time, and later activity mainly responds periodically to user interactions.
The speaker adds that mobile memory constraints can make JIT compilation less attractive. They say React Native apps using JavaScriptCore typically do not use its JIT, while noting they do not have the full context for that behavior.
Takeaways
- Choose compilation strategies around the app’s workload and startup needs, not only peak execution speed.
- Precompiling bundled code can reduce work on the device when the runtime environment is controlled.
- Measure how often functions run before investing in JIT optimization; many React Native startup functions may run only once or not at all.
- Account for mobile memory use as well as CPU cost when deciding whether runtime compilation is worthwhile.
Mentioned in this talk
Search inside this talk
What was claimed 12
- integrates with
Hermes Agent integrates with React Native Framework
“with Hermes in React Native”
YouTube Verified2 sources· Talk
- uses
“certain steps happen ahead of time rather than just in time”
YouTube Unverified1 source· Talk
- featureJIT compilation: Compiles JavaScript to bytecode and then bytecode to machine code at runtime
“They compile JavaScript to bytecode just in time, then compile the bytecode to machine code just in time”
YouTube Unverified1 source· Talk
- metricJavaScript: Parsing and compilation can take 30% of the total time spent on JavaScript during a page load
“parsing and compilation can take 30% of the total time”
YouTube Unverified1 source· Talk
- uses
“All modern JavaScript engines, like ... JSC”
YouTube Unverified1 source· Talk
- usesV8 uses JIT compilation
“All modern JavaScript engines, like V8”
YouTube Unverified1 source· Talk
- uses
Hermes Agent uses SSA
“We generate an intermediate representation called SSA”
YouTube Unverified1 source· Talk
- feature
Hermes Agent: Generates an optimized bytecode bundle at build time for runtime loading and execution without a JIT
“We generate an optimized bytecode bundle at build time”
YouTube Unverified1 source· Talk
- feature
Meta: The Marketplace tab of the Facebook app is entirely in React Native
“the Marketplace tab of the Facebook app, which is entirely in React Native”
YouTube Unverified1 source· Talk
- uses
“Facebook's usage of React Native”
YouTube Unverified1 source· Talk
- featureNode.js: Its longer-lived, repetitive workload can suit a highly optimized JIT after the warm-up cost
“You pay the heavy warm-up cost once, then stay with very fast code”
YouTube Unverified1 source· Talk
- metricReact Native Framework: Most functions during startup are executed zero or one time
“most functions in React Native during startup are executed zero or one time”
YouTube Unverified1 source· Talk










