What are Parse, Compile and Evaluate in DevTools Performance tool? What are Parse, Compile and Evaluate in DevTools Performance tool? google-chrome google-chrome

What are Parse, Compile and Evaluate in DevTools Performance tool?


Parse:

The js engine goes over the code, determines all the different scopes, variable declarations etc. and sorts them. At this step also hoisting happens. Basically your plain text sourcecode is turned into an Abstract Syntax Tree (AST)

Compile:

Chromes V8 uses JIT compiling, that means that some parts of the js code are transfered into bytecode (that runs directly on your processor without any layer of abstraction inbetween). This increases performance. Sometimes it may decide to run the code directly without compiling it, e.g. if compiling it takes longer than actually running it unoptimized so there would be no benefit whatsoever.

Evaluating:

The code is run.

Read on:

How V8 optimizes

Bytecode vs. Running directly

All together