Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a baseline compiler?

I have struggled to find the definition of baseline compiler and baseline interpreter and I am quite surprised that it’s not mentioned anywhere.

If I am not wrong, a baseline compiler will compile code into a bytecode rather than architecture dependent machine code, right?

like image 750
Uday Hiwarale Avatar asked Jan 08 '20 01:01

Uday Hiwarale


1 Answers

After digging into many articles and books, I was able to deduce the meaning of “baseline compiler”.

Basically, the job of a baseline compiler is to generate bytecode or machine code as fast as possible. This output code (machine code or intermediate code) however is not very optimized for a processor, hence it's very inefficient and slow in runtime.

On the other hand, an optimization compiler produces an efficient code but it takes a much longer time to do so.

Hence baseline compiler is useful when you want to load and run your application as quickly as possible and later optimize the code with an optimization compiler in the background.

like image 145
Uday Hiwarale Avatar answered Nov 12 '22 16:11

Uday Hiwarale