Fast algorithms for compressed multimethod dispatch table generation

The efficiency of dynamic dispatch is a major impediment to theadoption of multimethods in object-oriented languages. In thisarticle, we propose a simple multimethod dispatch scheme based oncompressed dispatch tables. This scheme is applicable to anyobject-oriented language using a method precedence order thatsatisfies a specific monotonous property (e.g., as Cecil and Dylan)and guarantees that dynamic dispatch is performed in constant time,the latter being a major requirement for some languages andapplications. We provide efficient algorithms to build the dispatchtables, provide their worst-case complexity, and demonstrate theeffectiveness of our scheme by real measurements performed on twolarge object-oriented applications. Finally, we provide a detailedcomparison of our technique with other existing techniques.

[1]  Christian Queinnec Fast and Compact Dispatching for Dynamic Object-Oriented Languages , 1997, Inf. Process. Lett..

[2]  Alexander Borgida,et al.  Efficient management of transitive relationships in large data and knowledge bases , 1989, SIGMOD '89.

[3]  David Robson,et al.  Smalltalk-80: The Language and Its Implementation , 1983 .

[4]  Bjarne Stroustrup,et al.  The Annotated C++ Reference Manual , 1990 .

[5]  Marie-Laure Mugnier,et al.  Monotonic conflict resolution mechanisms for inheritance , 1992, OOPSLA.

[6]  Bruce G. Lindsay,et al.  Static type checking of multi-methods , 1991, OOPSLA '91.

[7]  Jim Melton An SQL3 snapshot , 1996, Proceedings of the Twelfth International Conference on Data Engineering.

[8]  Olivier Gruber,et al.  Optimizing Multi-Method Dispach Using Compressed Dispach Tables , 1994, BDA.

[9]  Daniel G. Bobrow,et al.  Common lisp object system specification , 1988, SIGP.

[10]  Craig Chambers,et al.  Object-Oriented Multi-Methods in Cecil , 1992, ECOOP.

[11]  John G. Hosking,et al.  Multi-Methods in a Statically-Typed Programming Language , 1991, ECOOP.

[12]  Karel Driesen Selector table indexing & sparse arrays , 1993, OOPSLA '93.

[13]  Peter Dencker,et al.  Optimization of parser tables for portable compilers , 1984, TOPL.

[14]  R. Nigel Horspool,et al.  Taming Message Passing: Efficient Method Look-Up for Dynamically Typed Languages , 1994, ECOOP.

[15]  Olivier Gruber,et al.  Optimizing Multi-Method Dispatch Using Compressed Dispatch Tables , 1994, OOPSLA.

[16]  Urs Hölzle,et al.  Reconciling responsiveness with performance in pure object-oriented languages , 1996, TOPL.

[17]  Volker Turau,et al.  Multiple-Dispatching Based on Automata , 1995, Theory Pract. Object Syst..

[18]  L. Peter Deutsch,et al.  Efficient implementation of the smalltalk-80 system , 1984, POPL.

[19]  Eric Simon,et al.  Type-safe relaxing of schema consistency rules for flexible modelling in OODBMS , 1996, The VLDB Journal.

[20]  Craig Chambers,et al.  The cecil language: specification and rationale , 1993 .

[21]  Robert Sims,et al.  Alpha architecture reference manual , 1992 .

[22]  Jean-Claude Royer,et al.  Optimizing method search with lookup caches and incremental coloring , 1992, OOPSLA '92.

[23]  Donald E. Knuth The art of computer programming: fundamental algorithms , 1969 .

[24]  Marie-Laure Mugnier,et al.  Proposal for a Monotonic Multiple Inheritance Linearization , 1994, OOPSLA.

[25]  D. A. Moon,et al.  Common lisp object system specification , 1988, SIGP.

[26]  Eric Dujardin Efficient Dispatch of Multimethods in Constant Time Using Dispatch Trees , 1996 .

[27]  Craig Chambers,et al.  Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches , 1991, ECOOP.

[28]  Andreas Paepcke CLOS, Eiffel, and Sather: A Comparison , 1993 .

[29]  AgrawalRakesh,et al.  Static type checking of multi-methods , 1991 .

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

[31]  Jan Vitek,et al.  Compact Dispatch Tables for Dynamically Typed Programming Languages , 1996 .

[32]  R. Nigel Horspool,et al.  Compact Dispatch Tables for Dynamically Typed Object Oriented Languages , 1996, CC.

[33]  Gary T. Leavens,et al.  Typechecking and Modules for Multimethods , 1995, ACM Trans. Program. Lang. Syst..

[34]  Eric Amiel,et al.  Supporting Explicit Disambiguation of Multi-Methods , 1996, ECOOP.

[35]  Daniel G. Bobrow,et al.  CommonLoops: merging Lisp and object-oriented programming , 1986, OOPLSA '86.

[36]  James R. Bell A Compression Method for Compiler Precedence Tables , 1974, IFIP Congress.

[37]  Ralph E. Johnson,et al.  TS: an optimizing compiler for smalltalk , 1988, OOPSLA '88.

[38]  C. Chambers,et al.  CLOS Eiffel and Sather: A Comparison , 1991 .

[39]  Shih-Kun Huang,et al.  Two-way coloring approaches for method dispatching in object-oriented programming systems , 1992, [1992] Proceedings. The Sixteenth Annual International Computer Software and Applications Conference.

[40]  Ifor Williams,et al.  The design and evaluation of a high-performance smalltalk system , 1988 .

[41]  Paul Schweizer,et al.  A fast method dispatcher for compiled languages with multiple inheritance , 1989, OOPSLA '89.

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

[43]  Donald Ervin Knuth,et al.  The Art of Computer Programming, 2nd Ed. (Addison-Wesley Series in Computer Science and Information , 1978 .

[44]  Gregor Kiczales,et al.  Efficient method dispatch in PCL , 1990, LISP and Functional Programming.

[45]  David A. Moon,et al.  A monotonic superclass linearization for Dylan , 1996, OOPSLA '96.

[46]  Craig Chambers,et al.  An efficient implementation of SELF, a dynamically-typed object-oriented language based on prototypes , 1989, OOPSLA '89.

[47]  S. Muthukrishnan,et al.  Efficient Dynamic Method-Lookup for Object Oriented Languages (Extended Abstract) , 1996, Embedded Systems and Applications.

[48]  Craig Chambers,et al.  Object, message, and performance: how they coexist in Self , 1992, Computer.

[49]  Craig Chambers,et al.  Making pure object-oriented languages practical , 1991, OOPSLA '91.

[50]  David A. Patterson,et al.  What Price Smalltalk? , 1987, Computer.