This paper has presented a low overhead enabling optimization for C++ programs that contain virtual functions. This optimization replaces each dynamic function call with a switch statement and a collection of static function calls. Most compilers are better able to analyze programs with static function calls; thus, our optimization enables other optimizations.
Our experimental data are promising for a prototype implementation. We obtained a consistent performance improvement except on the largest program running on the machine with the smallest cache. The numbers for the employee example, with its high percentage of virtual function calls, are particularly encouraging. We would expect these numbers to improve if our optimization was integrated into a compiler, rather than being implemented as a source-to-source transformation.
Copyright © 1995, 1996 Bradley M. Kuhn, David W. Binkley.
Verbatim copying and distribution of this entire paper is permitted in any medium, provided this notice is preserved.