Skip to main content
Log in

Class hierarchy specialization

  • Original article
  • Published:
Acta Informatica Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

Author information

Authors and Affiliations

Authors

Additional information

Received: 11 May 1999 / 14 December 1999

Rights and permissions

Reprints 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

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1007/PL00013298

Keywords

Navigation