Authors: Stephen Fink, David Grove, and Michael Hind
Citation: This tutorial was given at CGO 2004 and PLDI 2004.
The past decade has witnessed the widespread adoption of programming languages designed to execute on virtual machines, such as the Java and C# programming language. However, such languages face significant performance challenges beyond those confronted by traditional languages. First, portable program representations and dynamic language features, force the deferral of most optimizations until runtime, inducing runtime optimization overhead. Second, modular program representations preclude many forms of whole-program interprocedural optimization. Third, virtual machines incur additional costs for runtime services such as security guarantees and automatic memory management. To address these challenges, mainstream virtual machine implementations include substantial infrastructure for online profiling, dynamic compilation, and feedback-directed optimization. As a result, adaptive optimization has begun to mature as a widespread production-level technology.
This tutorial will survey the state-of-the-art in the areas of dynamic compilation and adaptive optimization in virtual machines. Dynamic compilation is the process of dynamically optimizing a portable representation, such as Java bytecodes, into native code. Adaptive optimization is the online decision process that determines the overall strategy for profiling and employing dynamic compilation. In addition to surveying the state-of-the-art, this tutorial will also debunk several misconceptions about these two topics, such as
- Dynamic compilers must be blazingly fast.
- Dynamic class loading is a fundamental roadblock to cross-method optimization.
- A static compiler can always get better performance than a dynamic compiler.
- Sophisticated profiling is too expensive to perform online.
- Program optimization is a dead field.
- Lack of a suitable infrastructure is a significant barrier to research in this area.
