Dynamic vs. Static Optimization Techniques for Object-Oriented Languages


Urs Hölzle and Ole Agesen
Abstract: Object-oriented programs can be optimized either dynamically, i.e., based on run-time information, or statically, i.e., based on program analysis alone. Two promising optimization techniques for object-oriented languages are type feedback (dynamic) and concrete type inference (static). We directly compare the two techniques, evaluating their effectiveness on a suite of 23 SELF programs while keeping other factors constant.

Our results show that both systems inline >95% of all sends and deliver similar overall performance with one exception: SELF's automatic coercion of machine integers to arbitrary-precision integers upon overflow confounds type inference and slows down arithmetic-intensive benchmarks. We also show that a system combining the two optimizations can combine their strengths and outperform each individual optimization.

We discuss several other issues which, given the comparable run-time performance, may influence the choice between type feedback and type inference.


Theory and Practice of Object Systems 1(3), 1996

An earlier version of this paper is here (PDF).