https://news.ycombinator.com/item?id=20413046
The key is that Hermes is optimized for a totally different environment and workload - RN apps from disk on slow Android devices vs. websites downloaded on desktop computers.
The fact that Hermes is architected for RN from the beginning is key. Bytecode is as compact as possible, and is mmap’d. mmap’d bytecode is a very deep change with huge benefits, but also limits some optimizations other engines rely on, such as inline caching.
Also note Hermes does not have a JIT to save memory and APK size. A lot of the heroic perf work in V8/JSC is in the JIT which is not useful in most RN scenarios/environments.
They don't ship minified javascript to final app, but bytecode, which they say is 1/3 smaller (both minified). They have moved the parse and compile stages to ahead of time, making the VM smaller, and giving the bytecode benefit. The bytecode benefit also means a quicker time to live/first reponse from 4s to 2s in their example.
Link to the talk, from FB employee announcement made at React Conference today, 15 minutes length. Linked 2 mins in, because the audio is poor to start.
It sounds like Hermes is exclusively for running React Native on mobile. They could start building React directly into Hermes— the reconciling algorithm for example, or maybe even some real parallelism.
Very curious to see how all this keeps evolving.
At the moment Hermes isn't compatible with ES6 (it's missing a lot of stuff). Perhaps, since part of the build step for RN anyway is transpiling, they don't need to provide all of ECMA's features. ES5 is more simple, less complex so I wonder if some performance can be had there.
But since they are building an engine strictly for making native apps using JS, there may be shortcuts or other stuff they can drop that JSC/V8 normally have to worry about but that's just speculation.
I'd love to see more info addressing your questions!
RN apps are rarely CPU bound though, so they don't necessarily benefit as much from those same optimizations.
It's really easy to build a React Native app, but not easy to build a really good one.
Hermes can make many more assumptions and so the engineers, even if they built something very similar to V8, can probably dial the knobs much more differently to optimize for what Hermes cares about.
(For the unawares, RN necessarily uses the system JSC on iOS per Apple requirements, but for Android RN bundles JSC into the APK.)
I don't understand how Hermes will differ from JSC/V8 in terms of functionality and performance. What functionality can be left out of Hermes as compared to JSC/V8 in order to shrink its sie?
What sorts of performance improvements will Hermes have that wouldn't similarly benefit JSC/V8, and why wouldn't Apple/Google include those in their own engines?