Two-directional record layout for multiple inheritance

Much recent work in polymorphic programming languages allows subtyping and multiple inheritance for records. In such systems, we would like to extract a field from a record with the same efficiency as if we were not making use of subtyping and multiple inheritance. Methods currently used make field extraction 3-5 times slower, which can produce a significant overall performance slowdown. We describe a record layout algorithm that allows us to assign a fixed offset to each field name. This allows field extraction to done just as quickly as in systems that do not provide multiple inheritance. Assigning fixed offsets may require us to leave gaps in some records (and waste space). However, by placing fields at both positive and negative offsets we can drastically reduce the amount of wasted space. Finding an optimal layout is NP-hard, so we propose and analyze heuristic algorithms for producing good two-direction record layouts. In a trial run, our algorithm produced a fixed layout for the instance variables of the 563 flavors of a Lisp Flavors system; this fixed layout only wastes 6% of the total space consumed by a collection of one instance of each flavor.

[1]  Bernard Robinet,et al.  Combinators and functional programming languages : Thirteenth Spring School of the LITP, Val d'Ajol, France, May 6-10, 1985, proceedings , 1986 .

[2]  E. F. Codd,et al.  Extending the database relational model to capture more meaning , 1979, ACM Trans. Database Syst..

[3]  Alan Borning,et al.  Multiple Inheritance in Smalltalk-BO , 1982, AAAI.

[4]  Carlo Zaniolo,et al.  An implementation of GEM: supporting a semantic data model on a relational back-end. , 1984, SIGMOD '84.

[5]  Stein Krogdahl Multiple inheritance in Simula-like languages , 1985, BIT Comput. Sci. Sect..

[6]  Richard T. Snodgrass Interface description language - definition and use , 1989, Principles of computer science series.

[7]  Ronald Morrison,et al.  An object addressing mechanism for statically typed languages with multiple inheritance , 1989, OOPSLA '89.

[8]  Mark A. Linton,et al.  Implementing relational views of programs , 1984, SDE 1.

[9]  David Alex Lamb,et al.  IDL: sharing intermediate representations , 1987, TOPL.

[10]  Renzo Orsini,et al.  GALILEO: a strongly-typed, interactive conceptual language , 1985, TODS.

[11]  John R. Rose,et al.  Fast dispatch mechanisms for stock hardware , 1988, OOPSLA '88.

[12]  Luca Cardelli,et al.  On understanding types, data abstraction, and polymorphism , 1985, CSUR.

[13]  Michael J. Carey,et al.  A recovery algorithm for a high-performance memory-resident database system , 1987, SIGMOD '87.

[14]  Grant Edwin Weddell Physical design and query compilation for a semantic data model (assuming memory residence) , 1987 .

[15]  Terry A. McKee,et al.  OOPSLA '89 Conference proceedings on Object-oriented programming systems, languages and applications , 1989 .