My Blog Posts

Facebook launches Hermes, an open source JavaScript engine to run React Native apps on Android

Facebook launches Hermes, an open source JavaScript engine to run React Native apps on Android


Facebook software engineer Marc Horowitz introduced Hermes at the Chain React 2019 conference in Portland, Oregon yesterday . Hermes is a new tool for developers to improve app startup performance, as Facebook does for apps, and to make apps more efficient on low-quality smartphones.

Hermes' default advantage is that developers can target all three mobile platforms with a single code base; However, as within any cross-platform framework, there are differences in performance, security and flexibility. GitHub has GitHub'da Hermes for use by all developers. It also has its own Twitter account and home page.

Horowitz stressed that Hermes reduced the APK size to half of its 41 MB and removed a quarter of the application's memory usage.

In other words, with Hermes, developers can enable users to interact faster with an application with fewer blocks, such as restrictions caused by multiple applications shared on low download times and limited memory sources, especially on low-quality phones.

And these are exactly the phones Facebook is targeting with Hermes. Compared to the high-quality phones that paid developers usually use.

"As developers, we tend to carry the latest flagship devices. Most users in the world do not have "said" Frequently used Android devices have less memory and less memory than the latest phones, and much less memory than the desktop. This is especially true outside the United States. Mobile flash is also relatively slow and high leading to I/O delay. "

This is not every day when a new JavaScript engine arises, but while there are plenty of browsers available to Google's V8, Mozilla notes that SpiderMonkey, Microsoft's Chakra, Horowitz Hermes is not aimed at browsers or how to server-side on node.js.

"We are not trying to compete in the browser area or in the server area. Hermes could have been in theory for such cases of use, which was never our goal.

The records report that Facebook has no plans to push Hermes beyond The Nation.js beyond React Native or turn it into the basis of a Facebook-branded browser. This is because it is optimized for mobile apps and does not offer advantages over other engines in other usage scenarios.

Instead of installing and then parsing JavaScript, Hermes tries to be efficient through a byte code precompile. Hermes uses a pre-made (AO) assembly during mobile app creation to allow more comprehensive byte code optimization. Along similar lines, the Fuchsia Dart compiler for iOS is an AOT compiler.

There are other ways to get more performance from JavaScript, for example, the V8 engine offers a capability called custom snapshots. However, this is technically a little more challenging than using Hermes.

Hermes also abandons the full-time (JIT) compiler used by other JavaScript engines to compile frequently interpreted code in machine code. In the context of React Native, JIT doesn't do much to simplify mobile app workloads.

The reason For Hermes's existence is to make React Native better, as it does on Facebook. "Hermes allows for more optimization on mobile as developers control the build stack," a Facebook spokesperson emailed The Register. "For example, we have applied a byte code precompile to improve performance and have developed more efficient garbage collection to reduce memory usage."

In a discussion with Hacker News, Microsoft developer Andrew Coates claims that Hermes has internal testing and 21.5MB runtime memory effect, compared with 1.4s for tti V8, 1.1sec de Hermes in conjunction with Microsoft Office for Android Indigenous Response compared to 30 MB with that V8.

Hermes is mostly compatible with ES6 JavaScript. There is no support for some language features such as expressions and local mode eval (to keep the engine small).

A Facebook spokesperson told The Register they plan to release benchmark figures next week to support performance claims.



Share this article


Comments (1)

  • 
                                                                                                                          John McCain
    John McCain Reply

    Thanks for this info

    1 year ago

Comment