Built-in Optimizations¶

submited by
Style Pass
2021-06-06 15:30:05

Pyjion is a JIT compiler. It compiles native CPython bytecode into machine code. Without Pyjion, CPython uses a master evaluation loop (called the frame evaluation loop) to iterate over opcodes

There is some added complexity, because .NET CIL requires that the value stack is a LIFO stack, whereas CPython implements a value “stack” but actually uses it like an array.

The calling of the C API method is wrapped by the .NET CEE_CALL opcode, which calls a wrapper method implemented in the intrins.cpp file.

Without further optimizations, Pyjion would perform roughly the same as CPython (as fast or slow as the C API methods its calling).

The benefits of Pyjion come from changing the emitted machine code by deterministic observations about the inputs, constants or environment.

CIL to machine code/assembly optimizations are done by the .NET/EE compiler. They are configured by CorJitInfo::getJitFlags().

Leave a Comment