Advertisement

Acta Informatica

, Volume 36, Issue 12, pp 927–982 | Cite as

Class hierarchy specialization

  • Frank Tip
  • Peter F. Sweeney
Original article

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.

Keywords

Execution Time Distinct Classis Memory Usage Object Size Access Pattern 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2000

Authors and Affiliations

  • Frank Tip
    • 1
  • Peter F. Sweeney
    • 1
  1. 1.IBM T.J. Watson Research Center, P.O. Box 704, Yorktown Heights, NY 10598, USA (e-mail: tip@watson.ibm.com, pfs@us.ibm.com) US

Personalised recommendations