Abstract.
Many class libraries are designed with an emphasis on generality and extensibility. Applications often exercise only part of a library's functionality. As a result, the objects created by an application may contain unused (user-specified or compiler-generated) members. Redundant members in objects are undesirable because they increase an application's memory usage.
We present an algorithm for specializing a class hierarchy with respect to its usage in a program \(\cal P\). That is, the algorithm analyzes the member access patterns for \(\cal P\)'s variables, and creates distinct classes for variables that access different members. The algorithm addresses the inheritance mechanisms of C++ in their full generality, including multiple inheritance and virtual (shared) inheritance.
Class hierarchy specialization reduces object size, and can be viewed as a space optimization. However, execution time may also be reduced through reduced object creation or destruction time, and caching and paging effects. Class hierarchy specialization may also create new opportunities for existing optimizations such as call devirtualization and inlining. In addition, specialization may be useful in tools for software maintenance and program understanding.
Similar content being viewed by others
Author information
Authors and Affiliations
Additional information
Received: 11 May 1999 / 14 December 1999
Rights and permissions
About this article
Cite this article
Tip, F., Sweeney, P. Class hierarchy specialization. Acta Informatica 36, 927–982 (2000). https://doi.org/10.1007/PL00013298
Issue Date:
DOI: https://doi.org/10.1007/PL00013298