Java / GraalVM Interview questions
What is the purpose of the Graal compiler's tiered execution?
Tiered compilation is a strategy where code starts out running in a cheap mode and only gets progressively more expensive optimization applied once it's proven to be worth it, balancing startup latency against peak throughput.
| Tier | Behavior |
| Interpreter / C1-like | Fast to produce, collects execution profile data |
| Graal (limited) | Applies some optimizations once a method is warm |
| Graal (full/top tier) | Full optimization - aggressive inlining, escape analysis, speculative optimizations - once a method is hot |
By only spending the Graal compiler's heavier analysis on methods that actually run often, tiered execution avoids wasting compilation time on code paths that execute once, while still giving hot loops the best possible machine code over time.
More Related questions...