Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article

Space efficient non-constant time multi-method dispatch in object oriented systems

Published: 03 April 2012 Publication History

Abstract

Multi-method dispatch in object oriented programs provides additional expressibility, readability and elegance over single dispatch languages. Optimizing multi-method dispatch is a central issue in compilers that support multi-methods. Existing constant time dispatch techniques for multi-methods keep either a lookup table or a lookup tree after compressing the same, the size of which can still be large if compression is not effective. In this paper, we propose a space efficient non-constant time technique (each method address should be computed - rather than being looked up) for multi-method dispatch with single inheritance type hierarchies. The method table containing all the multi-method signatures is the only data structure kept at run time. The table is arranged by sorting on argument position to expedite method search during dispatch. Heuristics is used during method search such that those methods which are not potential candidates are not included in the search. The proposed technique saves space significantly while the dispatch time grew higher compared to existing techniques. When multi-method counts were within practical bounds, the proposed technique was found to offer dispatch time similar to existing techniques.

References

[1]
Candy Pang, Wade Holst, Yuri Leontiev, and Duane Szafron. 1999. Multi-method Dispatch Using Multiple Row Displacement. In Proceedings of the 13th European Conference on Object-Oriented Programming (ECOOP '99), Rachid Guerraoui (Ed.). Springer-Verlag, London, UK, 304--328.
[2]
Craig Chambers. 1992. Object-Oriented Multi-Methods in Cecil. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP '92), Ole Lehrmann Madsen (Ed.). Springer-Verlag, London, UK, 33--56.
[3]
Curtis Clifton, Gary T. Leavens, Craig Chambers, and Todd Millstein. 2000. MultiJava: modular open classes and symmetric multiple dispatch for Java. In Proceedings of the 15th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications (OOPSLA '00). ACM, New York, NY, USA, 130--145.
[4]
Daniel H. H. Ingalls. 1986. A simple technique for handling multiple polymorphism. In Conference proceedings on Object-oriented programming systems, languages and applications (OOPLSA '86), Norman Meyrowitz (Ed.). ACM, New York, NY, USA, 347--349.
[5]
Eric Amiel, Olivier Gruber, and Eric Simon. 1994. Optimizing multi-method dispatch using compressed dispatch tables. In Proceedings of the ninth annual conference on Object-oriented programming systems, language, and applications (OOPSLA '94), Richard L. Wexelblat (Ed.). ACM, New York, NY, USA, 244--258.
[6]
Eric Dujardin. Efficient Dispatch of Multimethods in Constant Time with Dispatch Trees. Technical Report 2892, INRIA Rocquencourt, France, May 1996.
[7]
Eric Dujardin, Eric Amiel, and Eric Simon. 1998. Fast algorithms for compressed multimethod dispatch table generation. ACM Trans. Program. Lang. Syst. 20, 1 (January 1998), 116--165.
[8]
Gregor Kiczales and Luis Rodriguez. 1990. Efficient method dispatch in PCL. In Proceedings of the 1990 ACM conference on LISP and functional programming (LFP '90). ACM, New York, NY, USA, 99--105.
[9]
Karel Driesen and Urs Hölzle. 1995. Minimizing row displacement dispatch tables. In Proceedings of the tenth annual conference on Object-oriented programming systems, languages, and applications (OOPSLA '95). ACM, New York, NY, USA, 141--155.
[10]
Mayur Naik and Rajeev Kumar. 2000. Efficient message dispatch in object-oriented systems. SIGPLAN Not. 35, 3 (March 2000), 49--58.
[11]
P. Ferragina and S. Muthukrishnan. Efficient dynamic method-lookup for object oriented languages. In J. Diaz and M. Serna, editors, Algorithms-ESA '96, Fourth Annual European Symposium, volume 1136 of Lecture Notes in Computer Science, pages 107--120, Barcelona, Spain, 25-27 Sept. 1996. Springer.
[12]
Rajeev Kumar, Vikram Agrawal, and Anil Mangolia. 2005. Realization of multimethods in single dispatch object oriented languages. SIGPLAN Not. 40, 5 (May 2005), 18--27.
[13]
Rajeev Kumar and Vikram Agrawal. 2007. Multiple dispatch in reflective runtime environment. Comput. Lang. Syst. Struct. 33, 2 (July 2007), 60--78.
[14]
Rakesh Agrawal, Linda G. Demichiel, and Bruce G. Lindsay. 1991. Static type checking of multi-methods. In Conference proceedings on Object-oriented programming systems, languages, and applications (OOPSLA '91), Andreas Paepcke (Ed.). ACM, New York, NY, USA, 113--128.
[15]
W. Holst, D. Szafron, Y. Leontiev, and C. Pang. Multi-method dispatch using single-receiver projections. Technical Report TR-98-03, University of Alberta, Edmonton, Alberta, Canada, 1998.
[16]
Weimin Chen, Volker Turau, and Wolfgang Klas. 1994. Efficient Dynamic Look-Up Strategy for Multi-Methods. In Proceedings of the 8th European Conference on Object-Oriented Programming (ECOOP '94), Mario Tokoro and Remo Pareschi (Eds.). Springer-Verlag, London, UK, 408--431.

Cited By

View all
  • (2014)Fast Generic Dispatch for Common LispProceedings of ILC 2014 on 8th International Lisp Conference10.1145/2635648.2635654(89-96)Online publication date: 14-Aug-2014

Index Terms

  1. Space efficient non-constant time multi-method dispatch in object oriented systems

        Recommendations

        Comments

        Please enable JavaScript to view thecomments powered by Disqus.

        Information & Contributors

        Information

        Published In

        cover image ACM SIGSOFT Software Engineering Notes
        ACM SIGSOFT Software Engineering Notes  Volume 37, Issue 2
        March 2012
        92 pages
        ISSN:0163-5948
        DOI:10.1145/2108144
        Issue’s Table of Contents
        Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for third-party components of this work must be honored. For all other uses, contact the Owner/Author.

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        Published: 03 April 2012
        Published in SIGSOFT Volume 37, Issue 2

        Check for updates

        Author Tags

        1. message dispatch
        2. multi-methods
        3. multiple dispatch
        4. object oriented programming
        5. run-time type

        Qualifiers

        • Research-article

        Contributors

        Other Metrics

        Bibliometrics & Citations

        Bibliometrics

        Article Metrics

        • Downloads (Last 12 months)4
        • Downloads (Last 6 weeks)0
        Reflects downloads up to 07 Dec 2024

        Other Metrics

        Citations

        Cited By

        View all
        • (2014)Fast Generic Dispatch for Common LispProceedings of ILC 2014 on 8th International Lisp Conference10.1145/2635648.2635654(89-96)Online publication date: 14-Aug-2014

        View Options

        Login options

        View options

        PDF

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader

        Media

        Figures

        Other

        Tables

        Share

        Share

        Share this Publication link

        Share on social media