Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/320384.320407acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article
Free access

Efficient multiple and predicated dispatching

Published: 01 October 1999 Publication History

Abstract

The speed of message dispatching is an important issue in the overall performance of object-oriented programs. We have developed an algorithm for constructing efficient dispatch functions that combines novel algorithms for efficient single dispatching, multiple dispatching, and predicate dispatching. Our algorithm first reduces methods written in the general predicate dispatching model (which generalizes single dispatching, multiple dispatching, predicate classes and classifiers, and pattern-matching) into ones written using a simpler multimethod dispatching model. Our algorithm then computes a strategy for implementing multiple dispatching in terms of sequences of single dispatches, representing the strategy as a lookup DAG. Finally, our algorithm computes an implementation strategy separately for each of the single dispatches, producing for each dispatch a dispatch tree, which is a binary decision tree blending class identity tests, class range tests, and table lookups. Our algorithm exploits any available static information (from type declarations or class analysis) to prune unreachable paths from the lookup DAG, and uses any available dynamic profile information to minimize the expected time to search the dispatch trees. We measure the effectiveness of our dispatching algorithms on a collection of large Cecil programs, compiled by the Vortex optimizing compiler, showing improvements of up to 30% over already heavily optimized baseline versions.

References

[1]
Ole Agesen. The Cartesian Product Algorithm: Simple and Precise Type Inference of Parametric Polymorphism. In Proceedings ECOOP '95, Aarhus, Denmark, August 1995. Springer-Verlag.]]
[2]
Erie Amiel, Olivier Gruber, and Erie Simon. Optimizing Multi-Method Dispatch Using Compressed Dispatch Tables. In Proceedings OOPSLA "94, pages 244-258, Portland, OR, October 1994.]]
[3]
D. G. Bobrow, L. G. DeMichiel, R. P. Gabriel, S. E. Keene, G. Kiezales, and D.A. Moon. Common Lisp Object System Specification X3J13. SIGPLAN Notices, 28(Special Issue), September 1988.]]
[4]
Craig Chambers and David Ungar. Iterative Type Analysis and Extended Message Splitting: Optimizing Dynamically-Typed Object-Oriented Programs. In Proceedings of the A CM SIGPLAN '90 Conference on Programming Language Design and Implementation, pages 150--164, June 1990.]]
[5]
Craig Chambers. Object-Oriented Multi-Methods in Cecil. In O. Lehrmann Madsen, editor, Proceedings ECOOP "92, LNCS 615, pages 33--56, Utrecht, The Netherlands, June 1992. Springer-Verlag.]]
[6]
Craig Chambers. The Cecil Language: Specification and Rationale. Technical Report UW-CSE-93-03-05, Department of Computer Science and Engineering. University of Washington, March 1993. Revised, March 1997.]]
[7]
Craig Chambers. Predicate Classes. In O. Nierstrasz, editor, Proceedings ECOOP '93, LNCS 707, pages 268-296, Kaiserslautem, Germany, July 1993. Springer-Verlag.]]
[8]
Craig Chambers, Jeffrey Dean, and David Grove. Whole-Program Optimization of Object-Oriented Languages. Teelmieal Report UW-CSE-96-06-02, Department of Computer Science and Engineering. University of Washington, June 1996.]]
[9]
Weimin Chert, Volker Turau, and Wolfgang Klas. Efficient Dynamic Look-up Strategy for Multi-Methods. In M. Tokoro and R. Paresehi, editors, Proceedings ECOOP '94, LNCS 821, pages 408-431, Bologna, Italy, July 1994. Spdnget- Verlag.]]
[10]
Jeffrey Dean, David Grove, and Craig Chambers. Optimization of Object-Oriented Programs Using Smile Class Hierarchy Analysis. In Proceedings ECOOP "95, Aarhus, Denmark, August 1995. Springer-Verlag.]]
[11]
Jeffrey Dean, Greg DeFouw, Dave Grove, Vassily Litvinov, and Craig Chambers. Vortex: An Optimi, "zing ComPiler for Object-Oriented Languages. In OOPSLA 96 Conference Proceedings, San Jose, CA, October 1996.]]
[12]
Greg DeFouw, David Grove, and Craig Chambers. Fast Interprocedural Class Analysis. In Conference Record of the 25th A CM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 222-236, January 1998.]]
[13]
Karel Driesen and Urs H61zle. Minimizing Row Displacement Dispatch Tables. In OOPSLA'95 Conference Proceedings, pages 141-155, Austin, TX, October 1995.]]
[14]
Karel Driesen. Selector Table Indexing & Sparse Arrays. In Proceedings OOPSLA '93, pages 259-270, October 1993. Published as ACM SIGPLAN Notices, volume 28, number 10.]]
[15]
Karel Driesen, Urs Holzle, and Jan Vitek. Message Dispatch on Pipelined Processors. In Proceedings ECOOP '95, Aarhus, Denmark, August 1995. Springer-Verlag.]]
[16]
Eric Dujardin. Efficient Dispatch of Multimehtods in Constant Time with Dispatch Trees. Technical Report 2892, INRIA, Rocquencourt, France, 1996.]]
[17]
Eric Dujardin, Eric Amiel, and Eric Simon. Fast algorithms for compressed mulfimethod dispatch table generation. A CM Transactions on Programming Languages and Systems, 20( 1):116-165, January 1998.]]
[18]
Patrick H. Dussud. TICLOS: An Implementation of CLOS for the Explorer Family. In Proceedings OOPSLA "89, pages 215- 220, October 1989. Published as ACM SIGPLAN Notices, volume 24, number 10.]]
[19]
Michael D. Ernst, Craig S. Kaplan, and Craig Chambers. Predicate Dispatching: A Unified Theory of Dispatch. In Proceedings ECOOP '98, Brussels, Belgium, July 1998. Springer-Verlag.]]
[20]
Mary F. Fernandez. Simple and Effective Link-Time Optimization of Modula-3 Programs. In Proceedings of the ACM SIGPLAN "95 Conference on Programming Language Design and Implementation, pages 103-115, June 1995.]]
[21]
Adele Goldberg and David Robson. Smalltalk-80: The Language and its implementation. Addision- Wesley, Reading, MA, 1983.]]
[22]
James Gosling, Bill Joy, and Guy Steele. The Java Language Specification. Addison-Wesley, Reading, MA, 1996.]]
[23]
David Grove, Jeffrey Dean, Charles Garrett, and Craig Chambers. Profile-Guided Receiver Class Prediction. In OOPSLA '95 Conference Proceedings, pages 108-123, Austin, TX, October 1995.]]
[24]
David Grove, Crreg DeFouw, Jeffrey Dean, and Craig Chambers. Call Graph Construction in Object Oriented Languages. in OOPSLA '97 Conference Proceedings, Atlanta, GA, October 1997.]]
[25]
J. Hamer, J.G. Hosking, and W.B. Mugridge. A Method for Integrating Classification Within an Object-Oriented Environment. Technical Report Auckland Computer Science Report No. 48, Department of Computer Science, University of Auckland, October 1990.]]
[26]
Urs H61zle, Craig Chambers, and David Ungar. Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches. In P. America, editor, Proceedings ECOOP '91, LNCS 512, pages 21-38, Geneva, Switzerland, July 15-19 1991. Springer-Verlag.]]
[27]
T.C. Hu and A. C. Tucker. "Optimal Computer Search Trees and Variable-Length Alphabetical Codes. SIAM Journal on Applied Mathematics, 21 (4):514-532, 1971.]]
[28]
Paul Hudak, Simon Peyton Jones, Philip Wadler, Brian Boutel, Jon Fairbairn, Joseph Fasel, Mafia Guzman, Kevin Hammond, John Hughes, Thomas Johnsson, Dick Kieburtz, Rishiyur Nikhil, Will Partain, and John Peterson. Report on the Programming Language Haskell, Version 1.2. SIGPLANNotices, 27(5), May 1992.]]
[29]
Laurem Hyafil and RonaldL. Rivest. Constructing optimal binary decision trees is NP-complete. Information Processing Letters, 5( 1): 15-17, May 1976.]]
[30]
Ralph E. Johnson. Type-Checking Smalltalk. In Proceedings OOPSLA '86, pages 315-321, November 1986. Published as ACM SIGPLAN Notices, volume 21, number 11.]]
[31]
Ralph E. Johnson, Justin O. Graver, and Lawrenee W. Zurawski. TS: An Optimizing Compiler for Smalltalk. In Proceedings OOPSLA '88, pages 18-26, November 1988. Published as ACM SIGPLAN Notices, volume 23, number 11.]]
[32]
Ted Kaehler and Glenn Krasner. LOOM Large Object-Oriented Memory for Smalltalk-80 Systems. In G. Krasner, editor, Smalltalk-80 m Bits of History, Words of Advice, chapter 14, pages 251-270. Addison-Wesley, 1983.]]
[33]
Gregor Kiczales and Luis Rodriguez. Efficient Method Dispatch in PCL. In 1990 ACM Conference on Lisp and Functional Programming, pages 99--105. ACM, ACM Press, June 1990.]]
[34]
Bertrand Meyer. Eiffel: the language. Prentice-Hall, 1992.]]
[35]
Robin MiMer, Mads Tote, Robert Harper, and David MacQueen. The Definition of Standard ML (Revised). MIT Press, Cambridge, MA, 1997.]]
[36]
Etienne Morel and Claude Renvoise. Global Optimization by Suppression of Partial Redundancies. Communications of the A CM, 22(2):96-103, February 1979.]]
[37]
Warwick B. Mugridge, John Hamer, and John G. Hosking. Multi-Methods in a Statically-Typed Programming Language. In P. America, editor, Proceedings ECOOP "91, LNCS 512, pages 307-324, Geneva, Switzerland, July 15-19 1991. Springer-Verlag.]]
[38]
Hiroaki Nakamura, Tamiya Onodera, and Mildo Takeuehi. Message dispatch using binary decision trees. Technical Report RT0137, IBM Research, Tokyo Research Laboratory, Kanagawa, Japan, March 1, 1996.]]
[39]
Greg Nelson. Systems Programming with Modula-3. Prentice Hall, Englewood Cliffs, NJ, 1991.]]
[40]
Candy Pang, Wade Hoist, Yuri Leonfiev, and Duane Szafron. Multi-Method Dispatch Using Multiple Row Displacement. In Proceedings ECOOP "99, Lison, Portugal, June 1999. Springer-Verlag.]]
[41]
Simon L. Peyton Jones. The Implementation of Functional Programming Languages. Prentice-Hall, 1987.]]
[42]
John Plevyak and Andrew A. Chien. Precise Concrete Type Inference for Object-Oriented Languages. In Proceedings OOPSLA '94, pages 324-340, Portland, OR, October 1994.]]
[43]
John R. Rose. Fast Dispatch Mechanisms for Stock Hardware. In Proceedings OOPSLA '88, pages 27-35, November 1988. Published as ACM SIGPLAN Notices, volume 23, number tl.]]
[44]
Andrew Shalit, editor. The Dylan Reference Manual. Addison-Wesley, Reading, MA, 1996.]]
[45]
Guy L. Steele Jr. Common Lisp: The Language. Digital Press, Bedford, MA, 1990. Second edition.]]
[46]
Bjame Stroustrup. The C++ Programming Language (second edition). Addision-Wesley, Reading, MA, 1991.]]
[47]
Antero Taivalsaari. Object-oriented programming with modes. Journal of Object-Oriented Programming, pages 25--32, June 1993.]]
[48]
Jan Vitek, Nigel Hot-spool, and Andreas Krall. Efficient Type Inclusion Tests. In Proceedings OOPSLA "97, Atlanta, GA, October 1997.]]
[49]
Olivier Zendra, Dominique Colnet, and Suzanne CoUin. Efficient Dynamic Dispatch Without Virtual Function Tables: The SmallEiffel Compiler. In OOPSLA "97 Conference Proceedings, Atlanta, GA, October 1997.]]

Cited By

View all
  • (2021)Taming the Merge OperatorJournal of Functional Programming10.1017/S095679682100018631Online publication date: 2-Nov-2021
  • (2010)Predicated generic functionsProceedings of the 9th international conference on Software composition10.5555/1894424.1894431(66-81)Online publication date: 1-Jul-2010
  • (2010)Algorithms for traversal-based generic programmingProceedings of the 6th ACM SIGPLAN workshop on Generic programming10.1145/1863495.1863504(61-72)Online publication date: 26-Sep-2010
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
OOPSLA '99: Proceedings of the 14th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
October 1999
462 pages
ISBN:1581132387
DOI:10.1145/320384
Permission to make digital or hard copies of all or part 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 components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 October 1999

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Conference

OOPSLA99
Sponsor:

Acceptance Rates

OOPSLA '99 Paper Acceptance Rate 30 of 152 submissions, 20%;
Overall Acceptance Rate 268 of 1,244 submissions, 22%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)111
  • Downloads (Last 6 weeks)16
Reflects downloads up to 09 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2021)Taming the Merge OperatorJournal of Functional Programming10.1017/S095679682100018631Online publication date: 2-Nov-2021
  • (2010)Predicated generic functionsProceedings of the 9th international conference on Software composition10.5555/1894424.1894431(66-81)Online publication date: 1-Jul-2010
  • (2010)Algorithms for traversal-based generic programmingProceedings of the 6th ACM SIGPLAN workshop on Generic programming10.1145/1863495.1863504(61-72)Online publication date: 26-Sep-2010
  • (2010)Predicated Generic FunctionsSoftware Composition10.1007/978-3-642-14046-4_5(66-81)Online publication date: 2010
  • (2009)Expressive and modular predicate dispatch for JavaACM Transactions on Programming Languages and Systems10.1145/1462166.146216831:2(1-54)Online publication date: 20-Feb-2009
  • (2008)Multiple dispatch in practiceACM SIGPLAN Notices10.1145/1449955.144980843:10(563-582)Online publication date: 19-Oct-2008
  • (2008)Filtered dispatchProceedings of the 2008 symposium on Dynamic languages10.1145/1408681.1408685(1-10)Online publication date: 8-Jul-2008
  • (2008)The RunaboutSoftware: Practice and Experience10.1002/spe.87838:14(1531-1560)Online publication date: 22-May-2008
  • (2007)Open multi-methods for c++Proceedings of the 6th international conference on Generative programming and component engineering10.1145/1289971.1289993(123-134)Online publication date: 1-Oct-2007
  • (2007)Multiple dispatch in reflective runtime environmentComputer Languages, Systems and Structures10.1016/j.cl.2005.09.00133:2(60-78)Online publication date: 1-Jul-2007
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media