Note: We have used commission links in this article and marked them with “*”. If an order is placed via these links, t3n.de receives a commission.
In order to achieve a better execution speed, this bytecode can be sent to an optimizing compiler together with collected profiling data. The optimizing compiler makes certain assumptions on the basis of this profiling data and then generates highly optimized machine code. If any of the assumptions are found to be incorrect at any time, the code is de-optimized and execution returns to the interpreter, which then gathers new profiling data to optimize the code again later.
Why do some engines have more compilers than others? An interpreter can generate bytecode quickly, but bytecode is generally not very efficient. An optimizing compiler, on the other hand, takes longer, but ultimately generates much more efficient machine code. It is therefore important to find the right compromise between generating code quickly (interpreter) or executing the generated code more quickly (optimizing compiler). Some engines choose to add multiple optimizing compilers with different timing and efficiency characteristics, which allows for finer control over these tradeoffs at the cost of additional complexity and compile times.