liveBook · Manning

Just-in-time compilation

As explained in Experimentation for Engineers

A just-in-time compiler translates code into machine code during program execution rather than exclusively before execution.

A just-in-time compiler translates code into machine code during execution. In a web server, its configuration affects the CPU time required to handle user requests, so compilation strategy becomes a production performance concern. section 6.1

Relevant parameters can control memory layout, the duration of interpreted monitoring before compilation, and inlining aggressiveness. The resulting behavior may be treated as a black box when internal compiler dynamics are unknown or unimportant. section 6.1 section 6.1.1

A practical tuning loop measures the compiled system rather than assuming parameter effects:

  • Choose a set of JIT parameter values. section 6.1
  • Configure the JIT and compile the web server code. section 6.1
  • Replay production-logged requests on production-equivalent hardware and measure CPU time. section 6.1 section 6.1.1
  • Repeat with suggested parameters until CPU time stops improving. section 6.1

A noisy JIT performance experiment

A simulator accepts seven parameter values between zero and one, computes an average CPU time, and adds random variation. The variation represents operating-system activity, cache fluctuations, and other measurement effects. Treating the simulator as a black box prevents the optimizer from relying on its internal formula. section 6.1.1

Figure 6.2 Bayesian optimization. After initialization at the center point, BO iterates through design, run, and analyze stages until the measured business metric stops changing. What makes BO so powerful is that the analyze and design stages are automated, freeing the engineer to devote more of their time to generating and implementing new ideas rather than to optimizing parameters.
06-02

The optimization loop alternates automated design, execution, and analysis until the measured business metric stops changing. section 6.1

How Experimentation for Engineers covers it

How deep it goes
Explains configurable behaviors and measurement workflow, but stops short of compiler implementation internals.
Examples
Uses a seven-parameter web server, replayed production requests, a CPU-time simulator, and noisy offline measurements.
What you can do after
Operate/configure a JIT and evaluate parameter sets using production-like CPU-time measurements.
How it connects
Connects JIT compilation with Bayesian optimization, black-box optimization, interpreted execution, inlining, and CPU-time measurement.

Also explained in

Compare how 7 books explain just-in-time compilation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Experimentation for Engineers. The section links point to the parts of the book it draws on.