# Just-in-Time Compilation (JIT)

> The parts that run most are made fast while the program runs.

**Field:** Software Development  
**Category:** Compilers & Runtimes  
**Also known as:** JIT, JIT Compiler, Just-in-Time Compiler

## Think of it like

Think of it like a cook who sees what most people order. That dish gets made ready early.

## Definition

Just-in-time compilation turns code into machine code while the program is running. The program starts out being read slowly, like with an interpreter. The JIT watches which parts run most often. It then compiles those parts into fast machine code on the spot. Browsers use a JIT for JavaScript, and the JVM uses one for Java.

## Example

A web game loops over its drawing code thousands of times. The browser's JIT compiles that loop, and the game stops stuttering.

## Why it matters

A JIT gives a quick start and fast running too. It is a big reason JavaScript became fast enough for whole apps.

## Common mistake

Judging speed by the first second. A JIT program often starts slow and gets faster once it warms up.

## Three principles

- **While running.** Compiling happens during the run.
- **Hot parts first.** Code that runs most gets compiled.
- **Warms up.** Speed grows the longer it runs.

## Related terms

- [Compiler](https://learn.benibix.com/term/development/compiler)
- [Interpreter](https://learn.benibix.com/term/development/interpreter)
- [Bytecode](https://learn.benibix.com/term/development/bytecode)
- [JavaScript](https://learn.benibix.com/term/development/javascript)
- [Java Virtual Machine (JVM)](https://learn.benibix.com/term/development/java-virtual-machine)
- [Common Language Runtime (CLR)](https://learn.benibix.com/term/development/common-language-runtime)

---

Source: https://learn.benibix.com/term/development/just-in-time-compilation
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
