Empirical Study of Object-Layout Strategies and Optimization Techniques

Although there is a large body of research on the time overhead of object oriented programs, there is little work on memory overhead. This paper takes an empirical approach to the study of this overhead, which turns out to be significant in the presence of multiple inheritance. We study the performance, in terms of overhead to object size of three compilation strategies: separate compilation, whole program analysis, and user annotations as done in C++. A variant to each such strategy is the inclusion of pointers to indirect virtual bases in objects. Using a database of several large multiple inheritance hierarchies, spanning 7000 classes, several application domains and different programming languages we find that in all strategies there are certain classes which give rise a large number of compiler generated fields in their object layout. We then study the efficacy of the recently introduced inlining and bidirectional object layout optimization techniques, and show that an average saving of close to 50% in this overhead can be achieved.

[1]  Mary E. S. Loomis,et al.  Is multiple inheritance essential to OOP? (panel) , 1993, OOPSLA '93.

[2]  James Gosling,et al.  The Java Programming Language" The Java Series , 1996 .

[3]  Randall B. Smith,et al.  SELF: The power of simplicity , 1987, OOPSLA '87.

[4]  Joseph Gil,et al.  Space and time-efficient memory layout for multiple inheritance , 1999, OOPSLA '99.

[5]  R. Nigel Horspool,et al.  Efficient type inclusion tests , 1997, OOPSLA '97.

[6]  Brad J. Cox,et al.  Object-oriented programming ; an evolutionary approach , 1986 .

[7]  Yen-Ping Shan,et al.  Panel - Is Multiple Inheritance Essential to OOP? , 1993, OOPSLA 1993.

[8]  簡聰富,et al.  物件導向軟體之架構(Object-Oriented Software Construction)探討 , 1989 .

[9]  Yves Caseau Efficient handling of multiple inheritance hierarchies , 1993, OOPSLA '93.

[10]  Markku Sakkinen The Darker Side of C++ Revisited , 1992, Struct. Program..

[11]  ShanYen-Ping,et al.  Is multiple inheritance essential to OOP? (panel) , 1993 .

[12]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[13]  Kenneth E. Iverson,et al.  A programming language , 1899, AIEE-IRE '62 (Spring).

[14]  Jan Vitek,et al.  Flexible Alias Protection , 1998, ECOOP.

[15]  Ken Arnold,et al.  The Java Programming Language , 1996 .

[16]  Karel Driesen,et al.  The direct cost of virtual function calls in C++ , 1996, OOPSLA '96.

[17]  Karel Driesen,et al.  Minimizing row displacement dispatch tables , 1995, OOPSLA.

[18]  Paulo Sérgio Almeida Balloon Types: Controlling Sharing of State in Data Types , 1997, ECOOP.

[19]  Niv Ahituv,et al.  SPEC as a Performance Evaluation Measure , 1995, Computer.

[20]  Mark A. Linton,et al.  Interface Translation and Implementation Filtering , 1994, C++ Conference.

[21]  R. Nigel Horspool,et al.  Near Optimal Hierarchical Encoding of Types , 1997, ECOOP.

[22]  Bjarne Stroustrup,et al.  The Design and Evolution of C , 1994 .

[23]  David F. Bacon,et al.  Fast static analysis of C++ virtual function calls , 1996, OOPSLA '96.

[24]  Hafedh Mili,et al.  Building and maintaining analysis-level class hierarchies using Galois Lattices , 1993, OOPSLA '93.