AOT compilation
In short: AOT (“ahead of time”) translates a program to machine code before it starts, instead of interpreting it at runtime or translating it with a JIT.
In more detail: C, C++, Rust and Go work this way classically. Languages with a virtual machine also offer AOT, such as GraalVM Native Image for Java or .NET Native AOT.
In Depth
- Advantages: Fast start, no warm-up, often less memory, simple delivery without a runtime.
- Disadvantages: Peak performance may fall below a JIT that uses real runtime data. Dynamic features such as reflection need configuration up front.
- Use: Serverless functions and containers where cold start matters, plus command-line tools.
- Hybrids: Profile-guided optimisation (PGO) feeds the AOT compiler with measurements from a trial run. Angular and Dart use AOT for fast web apps.
- Platform binding: The result runs only on the target architecture.
See also: intermediate representation and compiler optimisation