Home / Others / Facebook developers design Hermes to push multiplatform JavaScript at divine speeds • The Register

Facebook developers design Hermes to push multiplatform JavaScript at divine speeds • The Register



Facebook launched on Thursday a JavaScript engine called Hermes under an MIT open source license to improve the performance of React Native applications.

The announcement was made at the Chain React 2019 conference, which focuses on the development of React Native. React Native is an open source mobile application framework created by Facebook to develop applications for Android, iOS and Universal Windows Platform (UWP) using JavaScript, React (a JavaScript interface library) and native platform components. The advantage is supposed to be that developers can point to all three mobile platforms with a single code base; But as with any cross-platform framework, there are compromises in terms of performance, security and flexibility.

Hermes aims to address the performance commitment, which is particularly serious for Facebook because it has complicated mobile applications that depend on JavaScript. The amplified engine is designed to reduce the time of interaction (TTI), the time between the launch of the application and the ease of use of the application, a metric especially important for manufacturers of mass market applications, the size of the application and the use of memory.

As noted by Google's engineering manager, Addy Osmani, Google's V8 JavaScript engine spends a lot of time analyzing and compiling the JavaScript code before executing it, which leads to slower mobile app start times. According to Osmani, the analysis and compilation phases that precede the execution of architecture-specific machine instructions can be 2 to 5 times more on mobile devices than on desktop devices.

Hermes aims to be an alternative to Google V8 (Chromium), Apple's JavaScriptCore, SpiderMonkey and Mozilla's ChakraCore, the open source version or Microsoft's Chakra, which was left behind for V8 in the resurrection based on Redmond's Chromium from its Edge browser.

But for now it is only an alternative in the context of React Native applications. Hermes has not been prepared for other projects that rely on JavaScript engines, such as Node.js or frameworks such as Electron (cross-platform applications that use JavaScript instead of native code) that incorporate Chromium.

javascript

JavaScript tracking punks are given randomly by good records analysis of old-fashioned servers

Read more

According to Facebook, there is no plan to take Hermes beyond React Native to Node.js or turn it into the base of a browser with the Facebook brand. This is because it is optimized for mobile applications and would not offer advantages over other engines in other usage scenarios.

Hermes tries to be efficient through the precompilation of byte codes, instead of loading In similar lines, the Fuchsia Dart compiler for iOS is an AOT compiler.

There are other ways to squeeze more JavaScript performance. The V8 engine, for example, offers a capability called personalized snapshots. However, this is a bit more technically demanding than using Hermes.

Hermes is also the Just in Time (JIT) compiler used by other JavaScript engines to compile frequently interpreted code into machine code. In the context of React Native, JIT does a lot to ease the workloads of mobile applications.

The reason why Hermes exists, as Facebook says, is for React Native to be better. "Hermes allows greater optimization on mobile devices since developers control the compilation stack," a Facebook spokesperson said in an email to Register. "For example, we implemented precompilation of byte code to improve performance and develop a more efficient garbage collection to reduce memory usage."

Facebook, said a company spokesman, plans to publish baseline figures to support its performance claims next week. TTI using Hermes in 1.1s, compared to 1.4s for V8, and with a runtime memory impact of 21.5MB, compared to 30MB with V8.

Hermes is mostly compatible with ES6 JavaScript but not completely. To keep the engine small, compatibility with some language features is lacking, such as with declarations and local mode eval ().

A developer who works for a rival Facebook duty. Register that the success of Hermes will continue until the success of React Native unless it is taught how to compile on platforms other than Android. And in the immediate future, it can be expected that browsers will continue to use C ++-based execution times for performance and portability reasons. ®

hosted by:
Balance consumerization and corporate control.


Source link