V8 JavaScript engine

V8 is the name of the JavaScript engine that supports Google Chrome browser. This is something that requires our JavaScript and executes it when using the Chrome browser. V8 provides a runtime environment for running JavaScript. DOM and other Web platform APIs are provided by the browser.

V8 is the name of the JavaScript engine that supports Google Chrome browser. This is something that requires our JavaScript and executes it when using the Chrome browser.

V8 provides a runtime environment for running JavaScript. ThisDOM, And anotherWeb platform APIProvided by the browser.

The great thing is that the JavaScript engine is not affected by the browser hosting it. This main function promotesNode.js. V8 was selected as the engine that supports Node.js in 2009, and with the explosive development of Node.js, V8 has become the engine that now powers a large amount of server-side code written in JavaScript.

The Node.js ecosystem is very large. Thanks to V8, V8 also provides support for desktop applications and supports projects such as Electron.

Other JS engines

Other browsers have their own JavaScript engines:

  • Firefox browserSpider monkey
  • Safari hasJavaScript core(Also known as Nitro)
  • On the edgeChakras

There are many others.

All these engines implement the ECMA ES-262 standard, also known asECMAScript, The standard used by JavaScript.

Pursuit of performance

V8 is written in C++ and is continuously improved. It is portable and can run on Mac, Windows, Linux and several other systems.

In this introduction to V8, I will ignore the implementation details of V8: they can be found on more authoritative websites (such as the official V8 website), and they will undergo fundamental changes over time.

Like other JavaScript engines, V8 is constantly evolving to speed up the Web and Node.js ecosystem.

On the Internet, the performance race has been going on for many years, and we (as users and developers) have benefited a lot from this competition because we have been getting faster and more optimized machines year after year.

compilation

JavaScript is usually considered an interpreted language, but modern JavaScript engines no longer just interpret JavaScript, but compile it.

This has happened since the SpiderMonkey JavaScript compiler was added to Firefox 3.5 in 2009, and everyone has followed this idea.

JavaScript is compiled internally by V8,timely(on time)compilationSpeed up execution.

This may seem counterintuitive, but since the introduction of Google Maps in 2004, JavaScript has evolved from a language that usually executes dozens of lines of code to a complete application that runs thousands of lines in the browser .

Now, our application can run in the browser for hours, not just some form validation rules or simple scripts.

at thisNew world, So compiling JavaScript is very reasonable, because having JavaScript may take more timeget readyOnce completed, it will have higher performance than purely interpreted code.


More devtools tutorials: