Hermes: An Open Source JavaScript Engine Optimized for Mobile Apps
Article Summary
Facebook built a JavaScript engine from scratch because existing ones weren't cutting it for mobile. Hermes prioritizes what actually matters: startup time, app size, and memory usage.
Meta's engineering team open-sourced Hermes, a JavaScript engine specifically optimized for React Native apps on resource-constrained devices. Unlike traditional JS engines, it makes architectural trade-offs focused on mobile performance metrics rather than raw CPU speed.
Key Takeaways
- Bytecode precompilation happens at build time, eliminating parse delays at startup
- No JIT compiler by design: improves TTI and memory at cost of benchmark speed
- Custom garbage collector uses on-demand, noncontiguous allocation for 32-bit devices
- MatterMost app showed major gains in TTI, APK size, and memory on Pixel
- Enables one-line integration: just set enableHermes flag in build.gradle
Critical Insight
Hermes proves that rethinking engine architecture for mobile constraints delivers measurable wins in the metrics users actually feel: faster launches, smaller downloads, and fewer memory kills.