New JavaScript Engine optimized for React Native

Posted: 22-07-2019 | Views: 309
New JavaScript Engine optimized for React Native

Hermes: An open source JavaScript engine optimized for mobile apps, starting with React Native

Mobile applications are growing larger and more complex. Larger apps using JavaScript frameworks often experience performance issues as developers add features and complexity. These issues are generated from various spots, but the people using these apps expect them to run smoothly, regardless of the device they are on.

To increase the performance of Facebook’s apps, we have teams that continuously improve our JavaScript code and platforms. 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 with a desktop or laptop. After exploring other options, we built a new JavaScript engine we call Hermes. It is designed to improve app performance, focusing on our React Native apps, even on mass-market devices with limited memory, slow storage, and reduced computing power.

How Hermes improves React Native performance

For JavaScript-based mobile applications, user experience benefits from attention to a few primary metrics:

  • The time it takes for the app to become usable, called time to interact (TTI)
  • The download size (on Android, APK size)
  • Memory utilization

Developer experience

To start using Hermes, developers will need to make a few changes to their build.gradle files and recompile the app. See the full instructions for the migration to use Hermes on React Native.

 project.ext.react = [
  entryFile: "index.js",
  enableHermes: true
]

More info:Hermes: An open source JavaScript engine

Add comment