Facebook devs devise Hermes to push cross-platform JavaScript to godlike speeds

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

The ad made the announcement 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 commitments 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, an especially important measure for the manufacturers of applications of the mass market, the size of the application and the use of memory.

As Google's engineering manager Addy Osmani has observed that Google's V8 JavaScript engine spends a lot of time analyzing and compiling the JavaScript code before executing it, which leads to delaying the start times of mobile applications. 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 of Microsoft's Chakra, which left behind for V8 in Redmond's Chromium-based version of its Edge browser.

But for now it's just an alternative. The context of the native React 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 along with web technology instead of native code) that incorporate Chromium.

<img src = "https://regmedia.co.uk/2015/01/22/security_098877.jpg?x=174&y=115&crop=1" width = "174" height = "115" alt = "javascript [19659008] JavaScript tracking punks took a beating over good logging analyzes of outdated servers

READ MORE

According to Facebook, there is no plan to push Hermes beyond Reactive Native to Node.js or convert it into the base of a Facebook Brand Browser, 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 JavaScript and then analyzing it, Hermes uses it in advance (AOT) compilation during the compilation process of the mobile application to allow a more extensive bytecode optimization.Further, the Fuchsia compiler Dart for iOS is an AOT compiler. [19659002] 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 demanding from the technical point of view than the use of Hermes.

Hermes also discards the JIT compiler (JIT) used by other JavaScript engines to compile the code interpreted frequently in the machine code. In the context of React Native, JIT does not do much to alleviate the workloads of mobile applications.

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

Facebook, said a company spokesperson, plans to publish benchmark figures to support its performance claims next week. In a discussion on Hacker News, Microsoft developer Andrew Coates says that the internal tests of Hermes and React Native together with Microsoft Office for Android show that TTI uses Hermes in 1.1s, compared to 1.4s for V8, and with 21.5MB impact on memory at runtime, compared to 30MB with V8.

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

A developer working for a Facebook rival told The Register that Hermes' success will continue to be tied to the success of React Native unless it is taught 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. ®

Sponsored:
Balance consumerization and corporate control.

Download

Download Links:
1 http://go.theregister.com/feed/www.theregister.co.uk/2019/07/12/facebook_hermes_javascript/

For More Updates Check out Blog, Windows Softwares Drivers, Antivirus, Ms Office, Graphic Design Don’t Forget to Look Our Facebook Page Get Into Pc like us & follow on Twitter- @getinpc

Please Note: This content is provided and hosted by a 3rd party server. Sometimes these servers may include advertisements. igetintopc.com does not host or upload this material and is not responsible for the content.


Open

Close