Try   HackMD

Features of JavaScript Engines of Some Major Browsers

JavaScript engines are programmes that execute JavaScript code, converting it into machine code that the browser can understand. Different web browsers use different JavaScript engines, each optimized for performance, memory management, and execution speed. This article provides understanding of the JavaScript engines used by major browsers, as follows:

V8 (Google Chrome & Microsoft Edge)

The V8 Engine is used by Google Chrome, Microsoft Edge (since it switched to Chromium), Opera, and other Chromium-based browsers. It is developed by Google. The following are the features it offers:

  • Just-In-Time (JIT) compilation.
  • Uses two compilers: Full-codegen (for quick compilation) and TurboFan (for optimized execution).
  • Includes an interpreter called Ignition.
  • Supports WebAssembly.
  • Powers Node.js, allowing JavaScript to run outside browsers.

SpiderMonkey (Mozilla Firefox)

SpiderMonkey is used by Mozilla Firefox and developed by same. The features and facts about this engine include:

  • First JavaScript engine ever created.
  • Uses Just-In-Time (JIT) compilation.
  • Has an interpreter called Baseline, a JIT compiler called IonMonkey, and an optimization tool called Warp.
  • Supports WebAssembly.

JavaScriptCore (Safari - WebKit)

JavaScriptCore (also known as Nitro) is the engine used by Safari belonging to Apple who also developed it. The features it has are:

  • Just-In-Time (JIT) compilation.
  • Has different execution tiers: LLInt (Low-Level Interpreter), Baseline JIT, and DFG JIT (Data Flow Graph).
  • Supports WebAssembly.
  • Optimized for macOS and iOS devices.

Chakra (Internet Explorer)

The Chakra is used by Internet Explorer (IE 9-11) and developed by Microsoft with the following features:

  • JIT compilation for improved performance.
  • No longer actively developed, as IE has been replaced by Edge.

ChakraCore (Microsoft Edge - Legacy)

ChakraCore, the engine used by Microsoft Edge (before switching to Chromium) is expectedly developed by Microsoft with the following features:

  • A more advanced version of Chakra.
  • Supported Just-In-Time (JIT) compilation.
  • Open-source but now discontinued after Edge moved to Chromium.

Hermes (React Native)

Hermes (not a browser engine) is used by React Native apps and developed by Meta (Facebook). These are the features it provides:

  • Optimized for mobile performance.
  • Uses ahead-of-time (AOT) compilation instead of JIT.

Conclusion

The V8 is clearly the most widely used engine, powering Chrome, Edge, and Node.js. Others include SpiderMonkey; specialized for Firefox with JavaScriptCore (Nitro); optimized for Safari. Chakra is now said to be obsolete after Internet Explorer’s discontinuation and Hermes is specifically designed for React Native apps.