Hermes – A small JavaScript engine optimized for running React Native on Android
41–50 of 57 posts
Re: Hermes – A small JavaScript engine optimized for running React Native on Android
#42Earlier quoted context omitted.
We have done some internal tests of Hermes on a RN experience within Microsoft Office on Android. Currently we use V8 with bytecode caching on Android, since it provided better startup performance than the JSC engine that normally ships within RN. So the baseline is likely already faster than stock RN. V8 runtime Memory Impact: 30MB Hermes runtime memory impact: 21.5MB V8 time to interaction: 1.4s Hermes time to inte…
Very nice numbers, although worth mentioning hermes only appears to support es5, so there's way less stuff to load.
Re: Hermes – A small JavaScript engine optimized for running React Native on Android
#43There's a gazillion engineering hours between JavaScriptCore and V8. It seems crazy to write a JS engine from scratch as opposed to forking JSC or V8. (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 Her…
It's not an unreasonable task for a small team of skilled engineers who know V8 in depth, the kind that FB can and probably has recruited. If they're taking most of what V8 learned over the years into account, they'll know what to prioritize and what to not to.
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.
Re: Hermes – A small JavaScript engine optimized for running React Native on Android
#44Earlier quoted context omitted.
V8 and JSC are absolutely amazing pieces of technology. They'll run 60fps WebGL games or console emulators at incredible speeds. Huge props to the engineers that made that happen! RN apps are rarely CPU bound though, so they don't necessarily benefit as much from those same optimizations.
All those laggy react apps aren't CPU bound? What else is making them laggy?
It's really easy to build a React Native app, but not easy to build a really good one.
Re: Hermes – A small JavaScript engine optimized for running React Native on Android
#45There's a gazillion engineering hours between JavaScriptCore and V8. It seems crazy to write a JS engine from scratch as opposed to forking JSC or V8. (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 Her…
The same real world react app went from 40MB to 20MB. 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…
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.
Re: Hermes – A small JavaScript engine optimized for running React Native on Android
#46There's a gazillion engineering hours between JavaScriptCore and V8. It seems crazy to write a JS engine from scratch as opposed to forking JSC or V8. (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 Her…
The same real world react app went from 40MB to 20MB. 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…
Re: Hermes – A small JavaScript engine optimized for running React Native on Android
#47There's a gazillion engineering hours between JavaScriptCore and V8. It seems crazy to write a JS engine from scratch as opposed to forking JSC or V8. (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 Her…
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.
Re: Hermes – A small JavaScript engine optimized for running React Native on Android
#48Not clear what version of JS spec it supports. And what are these "optimizations for running React Native on Android". Just reducing startup/boot time or what?
The VM doesn't run JS directly, just bytecode so the version of the spec supported doesn't matter much. JS can be run through babel before going through the Hermes compiler.
Re: Hermes – A small JavaScript engine optimized for running React Native on Android
#49Worth noting that JSC on iOS for use in app-backend/business-logic code runs in interpreted mode [1]. Are Android versions of RN apps faster because Android's native V8 allows JIT, and Hermes also employs JIT? [1]: https://stackoverflow.com/questions/45422462/what-does-jit-i...
Re: Hermes – A small JavaScript engine optimized for running React Native on Android
#50They harp a lot on how fast it starts up - which sounds great - but I would like to have some solid numbers on what that startup time actually is on actual devices! I can't seem to find anything perusing around the GH page or the site
We have done some internal tests of Hermes on a RN experience within Microsoft Office on Android. Currently we use V8 with bytecode caching on Android, since it provided better startup performance than the JSC engine that normally ships within RN. So the baseline is likely already faster than stock RN. V8 runtime Memory Impact: 30MB Hermes runtime memory impact: 21.5MB V8 time to interaction: 1.4s Hermes time to inte…