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

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

Hermes' default advantage is that developers can target all three mobile platforms with a single codebase; However, as with any cross-platform framework, there are differences in performance, safety and flexibility. GitHub has Hermes for all developers to use. He also has his own Twitter account and login page .

Horowitz stressed that Hermes has reduced apk size by half of its 41 MB and removed a quarter of the app's memory usage.

In other words, with Hermes, developers can enable users to interact with an app faster with fewer obstacles, such as restrictions on low download times and limited memory resources, especially those caused by multiple apps shared 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 said "no." 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. The mobile flash is also relatively slow and leads to high I/O latency. ”

This is not every day that a new JavaScript engine is born, but while there are plenty of such engines available in browsers such as Google's V8, Mozilla's Notes that SpiderMonkey is not aimed at Microsoft's Chakra, Horowitz Hermes browsers or, for example, how to node.js on the server side.

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

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

Instead of installing JavaScript and parsing it later, Hermes tries to be efficient through a precompilation of byte code. Hermes uses pre-made (AOT) compilation during the mobile application creation process to allow for 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. The V8 engine, for example, offers a capability called custom snapshots. However, this is technically a little more challenging than using Hermes.

Hermes also abandons the just-in-time (JIT) compiler used by other JavaScript engines to compile frequently interpreted code in machine code. In the context of React Native, JIT does not do much to facilitate mobile app workloads.

The reason for Hermes' presence, as with Facebook, is to make Native React better. "Hermes allows for more optimization on mobile as developers control the build stack," a Facebook spokesperson told The Register by email. "For example, we implemented a precompilation of byte code to improve performance, and improved garbage collection more efficiently to reduce memory usage."

In a discussion with Hacker News, Microsoft developer Andrew Coates claimed that Hermes internally tested and has a 21.5MB runtime memory effect, compared with 1.4s for the TTI V8, 1.1sn also shows using Hermes in continging with Microsoft Office for Android Domestic 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 native mode eval () to keep the engine small.

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


KARABAY A, 2020 . Facebook launched Hermes, an open source JavaScript engine for running React Native apps on Android,


(Accessed July 22, 2019).

  Share this post

Comments (1)

  • Answer Mehmet

    Thank you for this information

    2 years ago


    Sign up for the email newsletter to be the first to know about my blog posts