Just-in-time compilation
Just-in-time compilation is the translation or optimization of program code into executable form during program execution.
Deep Learning with JAX
Compilation performed at runtime so code can be specialized and optimized for actual inputs and hardware.
- How it is used
- Speeds up large numerical computations and neural-network training across CPUs, GPUs, and TPUs.
- How deep it goes
- Explains decorators, tracing, Jaxpr, XLA, caching, static arguments, control flow, AOT compilation, and practical limitations.
- Examples
- Demonstrates SELU timing, MNIST training updates, static distance arguments, class-method helpers, and a moving-average exercise.
- What you can do after
- Apply it via jax.jit or @jax.jit, benchmark warmed-up executions, and diagnose purity, static-argument, and method errors.
Read how Deep Learning with JAX explains just-in-time compilation →
GPU Programming with Triton
JIT compilation translates program code into executable machine code at or near the time it is invoked.
- How it is used
- Uses JIT compilation to turn Triton kernel definitions into GPU code when kernels are first launched.
- How deep it goes
- Explains first-launch compilation, specialization, and caching, without detailing the intermediate-representation lowering pipeline.
- Examples
- Uses a live-interpreter analogy and the @triton.jit decorator to illustrate deferred compilation.
- What you can do after
- Apply JIT compilation by marking a Triton kernel with @triton.jit and accounting for compilation on its first launch.
Read how GPU Programming with Triton explains just-in-time compilation →
.NET in Action, Second Edition
A just-in-time compiler translates intermediate code into machine code during program execution.
- How it is used
- Explains how CoreCLR turns architecture-neutral CIL into executable machine code and why compilation timing matters for startup and benchmarks.
- How deep it goes
- Defines runtime compilation and describes selective and tiered behavior, but stops short of compiler implementation details and AOT instructions.
- Examples
- Uses a BenchmarkDotNet JSON-deserialization comparison whose pilot and warmup phases allow time for JIT compilation.
- What you can do after
- Evaluate/understand it when reasoning about startup costs and interpreting BenchmarkDotNet measurements.
Read how .NET in Action, Second Edition explains just-in-time compilation →
Julia as a Second Language
A just-in-time compiler compiles program code into executable machine code during program execution.
- How it is used
- Explains how Julia combines dynamic typing with high performance and why startup time matters.
- How deep it goes
- Explains execution timing and how argument types and fixed fields aid optimization, without detailing compiler algorithms.
- Examples
- Uses a Vec2D multiplication method and small, short-running scripts to illustrate type information and startup costs.
- What you can do after
- Evaluate whether JIT startup costs make Julia a good fit for a short-running script.
Read how Julia as a Second Language explains just-in-time compilation →
Deep Learning with R, Third Edition
Just-in-time compilation is the compilation of program code during execution into an optimized form for subsequent execution.
- How it is used
- Accelerates TensorFlow and JAX functions during execution after expressing them as compilable computations.
- How deep it goes
- Demonstrates function wrapping and an explicit JIT option, but does not explain compiler internals or optimization details.
- Examples
- Uses a TensorFlow dense-layer function with tf_function() and jit_compile = TRUE, plus JAX setup for analogous compilation.
- What you can do after
- Apply it via TensorFlow by wrapping a numerical function with tf_function() and enabling jit_compile when requested.
Read how Deep Learning with R, Third Edition explains just-in-time compilation →
Modern Angular
Just-in-time compilation is compilation performed during application startup or execution rather than entirely before deployment.
- How it is used
- Supports rapid Angular development by compiling templates through ng serve before browser rendering.
- How deep it goes
- Explains template-to-JavaScript compilation, development trade-offs, and AOT contrast, but omits compiler internals.
- Examples
- Uses ng serve for JIT development and ng build for a precompiled production application.
- What you can do after
- Evaluate when Angular development should use JIT and when deployment should use ahead-of-time compilation.
Experimentation for Engineers
A just-in-time compiler translates code into machine code during program execution rather than exclusively before execution.
- How it is used
- Optimizes JIT configuration to reduce CPU time for production-like web-server workloads.
- 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.
Read how Experimentation for Engineers explains just-in-time compilation →
Deep Learning with PyTorch, Second Edition
A compilation strategy that performs code optimization or translation during execution rather than before runtime.
- How it is used
- Deploys eager-mode PyTorch models as optimized graphs for production performance.
- How deep it goes
- Explains tracing, scripting, TorchScript, and dynamic capture, stopping short of compiler internals.
- Examples
- Uses a conditional PyTorch model, export failure, torch.compile, and original-versus-compiled output comparison.
- What you can do after
- Apply it via torch.compile to compile an eager-mode model and compare its compiled output with the original.
Read how Deep Learning with PyTorch, Second Edition explains just-in-time compilation →
Also covered in
- Vanilla WebIn early access (MEAP)
- PostgreSQL Mistakes and How to Avoid Them
- Logs and Telemetry
- Quarkus in Action
- Secrets of the JavaScript Ninja, Third EditionIn early access (MEAP)
- Go in Practice, Second Edition
- Writing for Developers: Blogs that get read
- Pro Angular 16
- Latency
What to know first
- machine languageMachine language is a processor-specific set of instructions encoded in a form that computer hardware can execute directly.
- PythonPython is a high-level, general-purpose, dynamically typed programming language with readable syntax and support for multiple programming paradigms.
- bytecodeBytecode is an intermediate instruction representation produced from source code for execution or further compilation by a virtual machine or language runtime.
- garbage collectionGarbage collection is an automated process that identifies and reclaims or removes memory, data, or other items no longer reachable or needed by a system.
Related concepts
- XLAuses · XLA (Accelerated Linear Algebra) is a compiler that optimizes and compiles machine-learning and array computations for supported hardware.
- JavaScript engineused by · A JavaScript engine is software that parses and executes JavaScript code, often compiling or interpreting it into instructions for execution.
- Juliaused by · Julia is a high-level, high-performance programming language designed for numerical, scientific, and technical computing.
- machine languageproduces · Machine language is a processor-specific set of instructions encoded in a form that computer hardware can execute directly.
- ahead-of-time compilationcontrasts with · Ahead-of-time compilation is the translation of program code into executable or loadable form before program execution begins.
- code compilationkind of · Code compilation is the transformation of source code or another formal representation into executable code or an intermediate or lower-level representation for execution or further processing.
Questions about just-in-time compilation
What is just-in-time compilation?
Just-in-time compilation is the translation or optimization of program code into executable form during program execution.
Which Manning books explain just-in-time compilation?
Deep Learning with JAX, GPU Programming with Triton, .NET in Action, Second Edition, Julia as a Second Language, Deep Learning with R, Third Edition, Modern Angular, Experimentation for Engineers and Deep Learning with PyTorch, Second Edition.
What should I know before learning just-in-time compilation?
Manning books that teach just-in-time compilation usually introduce machine language, Python, bytecode and garbage collection first.
What is the difference between just-in-time compilation and ahead-of-time compilation?
Just-in-time compilation is the translation or optimization of program code into executable form during program execution. Ahead-of-time compilation is the translation of program code into executable or loadable form before program execution begins.
What is just-in-time compilation a kind of?
Just-in-time compilation is a kind of code compilation. Code compilation is the transformation of source code or another formal representation into executable code or an intermediate or lower-level representation for execution or further processing.
What is just-in-time compilation also called?
Just-in-time compilation is also called JIT.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.







