X
Business

Facebook just released this new open source JavaScript engine

Facebook releases Hermes to improve app performance on low-end Android phones.
Written by Liam Tung, Contributing Writer

Facebook has released a new open source JavaScript engine, Hermes, to speed up start times for native Android apps built with Facebook's own React Native JavaScript framework. 

Facebook software engineer Marc Horowitz unveiled the new JavaScript engine at the Chain React 2019 conference on Thursday in Portland, Oregon. Hermes is a new tool for developers to primarily improve app startup performance in the same way Facebook already does for its apps, and to make apps more efficient on low-end smartphones. 

SEE: Amazon Alexa: An insider's guide (free PDF)

Open source Hermes is available on GitHub under an MIT license for all developers to use. It's also got its own Twitter account and home page

In a demo, Horowitz showed that a React Native app with Hermes was fully loaded within half the time the same app without Hermes loaded, or about two seconds faster.

The benefits of Hermes can be seen via key metrics Facebook uses to keep users of its apps hooked, including time to interaction (TTI), the size of the app file (APK) that Android users need to download, and how much memory it uses on an Android device. 

Horowitz boasted Hermes also cuts the APK size to half the 41MB of a stock React Native app, and shaves off a quarter of the app's memory usage. 

In other words, with Hermes developers can get users interacting with an app faster with fewer obstacles like slow download times and constraints caused by multiple apps sharing limited memory resources, especially on lower-end phones. 

And these are exactly the phones Facebook is aiming at with Hermes, compared to the fancy flagships that well-paid developers typically use themselves. 

"As developers we tend to carry the latest flagship devices. Most users around the world don't," he said. "Commonly used Android devices have less memory and less storage than the newest phones and much less than a desktop. This is especially true outside of the United States. Mobile flash is also relatively slow, leading to high I/O latency."

It's not every day a new JavaScript engine is born, but while there are plenty such engines available for browsers, like Google's V8, Mozilla's SpiderMonkey Microsoft's Chakra, Horowitz notes Hermes is not aimed at browsers or, for example, how Node.js on the server side.   

"We're not trying to compete in the browser space or the server space. Hermes could in theory could be for those kinds of use cases, that's never been our goal."

In the future Facebook intends to extend support to Microsoft's VS Code.

Editorial standards