Faster Compile Times and Better Performance: Bringing Just-in-Time Compilation to C++
summary
ClangJIT implements deferred instantiation by embedding serialized AST/modules and compiler state in object files, letting the program supply non‑type template values at runtime (types currently resolved from strings) and instantiate on demand without filesystem access. Ahead‑of‑time builds that compile three specializations take ~7s versus the JIT image build ~1s; runtime compilation of small template cases is milliseconds while runtime performance matches AOT and GPU kernels see up to 100x speedups for tiny matrices. It works but pays a first‑use compilation cost and has current limits around types, error reporting and resource management; CUDA support is included.
AI-written summary · about
chapters (35)
- 0:00Introduction
- 3:15Purpose
- 4:02Use Case
- 4:33Program Productivity
- 6:47JustinTime Compilation
- 7:40The Problem
- 8:10What does this mean
- 9:41Can you construct a JIT for C
- 11:50Specialization and generic programming
- 12:40JustinTime compilation and generic programming
- 13:51Cost of compilation
- 15:12Requirements
- 16:45HelloWorld
- 18:12More complicated example
- 19:23Semantics
- 20:43Limitations
- 21:37What happens when you compile
- 22:32Metadata
- 24:00Runtime
- 25:24Benchmarks
- 26:51Compile Time
- 28:56Performance Comparison
- 32:45Using JustinTime Compilation
- 33:13Simulation Code Example
- 36:34Costs
- 38:06Second example
- 38:58Benchmark
- 39:32How to hook CTRE
- 41:51Compiler Performance
- 42:55The Future
- 45:13Challenges Design Options
- 46:40Other Concerns
- 48:12Committee Feedback
- 50:26Underlying Question
- 51:03Conclusions
related talks
01h 04mJust-in-Time Compilation: The Next Big Thing?
26m“Easy::Jit: A Just-in-Time compilation library for C++”
19mReusing Just-in-Time Compiled Code
25mHybrid Execution: Combining Ahead-of-Time and Just-in-Time Compilation
30mOn Automating Hybrid Execution of Ahead-of-Time and Just-in-Time Compiled Code
50mJIT and AOT in the CLR
39mFireside chat on JIT compiler
20mLet's Build a Computation-Graph JIT Compiler in C++
