Tracing just-in-time compilation is a technique used by virtual machines to optimize the execution of a program at runtime.
The recorded operations are typically stored in trace tree, often in an intermediate representation (IR).
Traces are easy to optimize, since they represent only one execution path, which means that no control flow exists and needs no handling.
The first implementation of tracing is Dynamo, "a software dynamic optimization system that is capable of transparently improving the performance of a native instruction stream as it executes on the processor".
One DynamoRIO-based project was a framework for interpreter construction that combines tracing and partial evaluation.
[4] In 2006, HotpathVM, the first tracing JIT compiler for a high-level language[citation needed] was developed.
[5] This VM was capable of dynamically identifying frequently executed bytecode instructions, which are traced and then compiled to machine code using static single assignment (SSA) construction.
It enables the use of tracing JITs for language implementations that were written with PyPy's translation toolchain, thus improving the performance of any program that is executed using that interpreter.
[7] Tracing JITs have also been explored by Microsoft in the SPUR project for their Common Intermediate Language (CIL).
[8] Consider the following Python program that computes a sum of squares of successive whole numbers until that sum exceeds 100000: A trace for this program could look something like this: Note how the function call to square is inlined into the trace and how the if statement is turned into a guard_false.