EducationScience and Technology

Hermes JavaScript speeds up big apps

Facebook open-sources Hermes JavaScript engine to improve React Native Android app performance

Facebook is continuing its open-sourcing spree with the launch of a new JavaScript engine designed to improve the performance of big apps on Android devices, the company announced today at the Chain React conference in Portland, Oregon.

Mobile apps are getting increasingly larger, which can pose problems — particularly for devices with limited storage or processing power. This is one reason many big tech firms, including SpotifyUber, and Facebook itself, have taken to launching “lite” versions of their apps. But what if developers could improve the performance of their main apps by using an optimized JavaScript engine that reduces the download size and boosts startup performance?

That’s what Facebook set out to do first with its own suite of apps, for which it developed the Hermes JavaScript engine, which is now available on GitHub for any developer to use.

“To increase the performance of Facebook’s apps, we have teams that continuously improve our JavaScript code and platforms,” the company wrote in a blog post. “As we analyzed performance data, we noticed that the JavaScript engine itself was a significant factor in startup performance and download size. With this data in hand, we knew we had to optimize JavaScript performance in the more constrained environments of a mobile phone compared to a desktop or laptop.”

According to Facebook, Hermes helps improve three core app attributes: time-to-interact (TTI), which is the time it takes from launching an app to when it becomes fully loaded and usable; download size (Android .APK size); and memory utilization.

Here you can see some of the improvements it made with Mattermost (an open source Slack alternative) running on a Google Pixel phone, with the TTI down more than 2 seconds, the file-size down 19 MB, and the memory utilization down by 49 MB.

Above: Metrics for MatterMost React Native app running on a Google Pixel

Image Credit: Facebook


It’s worth noting that Hermes only works with apps that have been built using React Native, a mobile app framework developed by Facebook and open-sourced back in 2015. React Native’s core selling point is that code can run natively on different platforms (i.e. Android and iOS), and the framework has been used by some big brand apps, including Uber Eats and Walmart.

However, React Native hasn’t always been warmly received, due to some of its downsides — specific functionality in apps still require native code, for example, to support integration with the smartphone camera and sensors. And developers often have to create “bridges” to plug the gaps between native code and React Native. That is one of the reasons Airbnb, once an advocate for React Native, segued away from the framework last year.

But open-sourcing Hermes could be one way for Facebook to breathe new life into React Native and encourage further uptake among developers.

Given that Hermes is focused squarely on mobile apps, Facebook said it doesn’t have any plans to integrate Hermes with web browsers or server infrastructure, such as Node.js. “Existing JavaScript engines remain preferable in those environments,” the company said.

Hermes is the latest in a line of open source projects emanating from Facebook, with other recent projects including a deep learning framework called Pythia; a deep learning recommendation model called DLRM; and Spectrum, which is designed to make uploading photos more efficient.


 521 Total Page Views,  1 Views Today

Related Articles

Leave a Reply

Back to top button