Abstract
Object-oriented languages involve a threefold tradeoff between runtime efficiency, expressiveness (multiple inheritance), and modularity, i.e. open-world assumption (OWA). Runtime efficiency is conditioned by both the implementation technique and compilation scheme. The former specifies the data structures that support method invocation, attribute access and subtype testing. The latter consists of the production line of an executable from the source code. Many implementation techniques have been proposed and several compilation schemes can be considered from fully global compilation under the closed-world assumption (CWA) to separate compilation with dynamic loading under the OWA, with midway solutions. This article reviews a significant subset of possible combinations and presents a systematic, empirical comparison of their respective efficiencies with all other things being equal. The testbed consists of the Prm compiler that has been designed for this purpose. The considered techniques include C++ subobjects, coloring, perfect hashing, binary tree dispatch and caching. A variety of processors were considered. Qualitatively, these first results confirm the intuitive or theoretical abstract assessments of the tested approaches. As expected, efficiency increases as CWA strengthens. From a quantitative standpoint, the results are the first to precisely compare the efficiency of techniques that are closely associated with specific languages like C++ and Eiffel. They also confirm that perfect hashing should be considered for implementing Java and .Net interfaces.
- B. Alpern, A. Cocchi, S. Fink, and D. Grove. Efficient implementation of Java interfaces: Invokeinterface considered harmless. In Proc. OOPSLA'01, SIGPLAN Notices, 36(10), pages 108--124. ACM Press, 2001a. Google Scholar
Digital Library
- B. Alpern, A. Cocchi, and D. Grove. Dynamic type checking in Jalapeño. In Proc. USENIX JVM'01, 2001b. Google Scholar
Digital Library
- M. Arnold, S.J. Fink, D. Grove, M. Hind, and P.F. Sweeney. A survey of adaptive optimization in virtual machines. Proceedings of the IEEE, 93(2):449--466, Feb. 2005.Google Scholar
Cross Ref
- D. F. Bacon, M. Wegman, and K. Zadeck. Rapid type analysis for C++. Technical report, IBM Thomas J.Watson Research Center, 1996.Google Scholar
- D.F. Bacon and P. Sweeney. Fast static analysis of C++ virtual function calls. In Proc. OOPSLA'96, SIGPLAN Notices, 31(10), pages 324--341. ACM Press, 1996. Google Scholar
Digital Library
- H.-J. Boehm. Space-efficient conservative garbage collection. In Proc. ACM PLDI'93, ACM SIGPLAN Notices, 28(6), pages 197--206, 1993. Google Scholar
Digital Library
- D. Boucher. GOld: a link-time optimizer for Scheme. In M. Felleisen, editor, Proc. Workshop on Scheme and Functional Programming. Rice Technical Report 00-368, pages 1--12, 2000.Google Scholar
- C. Click and J. Rose. Fast subtype checking in the Hotspot JVM. In Proc. ACM-ISCOPE Conf. on Java Grande (JGI'02), pages 96--107, 2002. Google Scholar
Digital Library
- N.H. Cohen. Type-extension type tests can be performed in constant time. ACM Trans. Program. Lang. Syst., 13(4):626--629, 1991. Google Scholar
Digital Library
- S. Collin, D. Colnet, and O. Zendra. Type inference for late binding. the SmallEiffel compiler. In Proc. Joint Modular Languages Conference, LNCS 1204, pages 67--81. Springer, 1997. Google Scholar
Digital Library
- Z. J. Czech, G. Havas, and B. S. Majewski. Perfect hashing. Theor. Comput. Sci., 182(1-2):1--143, 1997. Google Scholar
Digital Library
- J. Dean, C. Chambers, and D. Grove. Selective specialization for object-oriented languages. In Proc. ACM PLDI'95, pages 93--102, 1995a. Google Scholar
Digital Library
- J. Dean, D. Grove, and C. Chambers. Optimization of objectoriented programs using static class hierarchy analysis. In W. Olthoff, editor, Proc. ECOOP'95, LNCS 952, pages 77--101. Springer, 1995b. Google Scholar
Digital Library
- R. Dixon, T. McKee, P. Schweitzer, and M. Vaughan. A fast method dispatcher for compiled languages with multiple inheritance. In Proc. OOPSLA'89, pages 211--214. ACM Press, 1989. Google Scholar
Digital Library
- K. Driesen. Efficient Polymorphic Calls. Kluwer Academic Publisher, 2001. Google Scholar
Digital Library
- R. Ducournau. Coloring, a versatile technique for implementing object-oriented languages. Rapport de Recherche 06-001, LIRMM, Université Montpellier 2, 2006.Google Scholar
- R. Ducournau. Perfect hashing as an almost perfect subtype test. ACM Trans. Program. Lang. Syst., 30(6):1--56, 2008. Google Scholar
Digital Library
- R. Ducournau. Implementing statically typed object-oriented programming languages. ACM Computing Surveys, 2009. (to appear). Google Scholar
Digital Library
- R. Ducournau. Yet Another Frame-based Object-Oriented Language: YAFOOL Reference Manual. Sema Group, Montrouge, France, 1991.Google Scholar
- R. Ducournau and F. Morandat. More results on perfect hashing for implementing object-oriented languages. Rapport de Recherche 09-001, LIRMM, Université Montpellier 2, 2009.Google Scholar
- R. Ducournau and J. Privat. Metamodeling semantics of multiple inheritance. Rapport de Recherche 08-017, LIRMM, Université Montpellier 2, 2008.Google Scholar
- N. Eckel and J. Gil. Empirical study of object-layout and optimization techniques. In E. Bertino, editor, Proc. ECOOP'2000, LNCS 1850, pages 394--421. Springer, 2000. Google Scholar
Digital Library
- M.A. Ellis and B. Stroustrup. The annotated C++ reference manual. Addison-Wesley, Reading, MA, US, 1990. Google Scholar
Digital Library
- M.R. Garey and D.S. Johnson. Computers and Intractability. A Guide to the Theory of NP-Completeness. W.H. Freeman and Company, San Francisco (CA), USA, 1979. Google Scholar
Digital Library
- J. Gil and P. Sweeney. Space and time-efficient memory layout for multiple inheritance. In Proc. OOPSLA'99, SIGPLAN Notices, 34(10), pages 256--275. ACM Press, 1999. Google Scholar
Digital Library
- A. Goldberg and D. Robson. Smalltalk-80, the Language and its Implementation. Addison-Wesley, Reading (MA), USA, 1983. Google Scholar
Digital Library
- D. Grove and C. Chambers. A framework for call graph construction algorithms. ACM Trans. Program. Lang. Syst., 23(6):685--746, 2001. Google Scholar
Digital Library
- S. P. Harbinson. Modula-3. Prentice Hall, 1992. Google Scholar
Digital Library
- U. Hölzle, C. Chambers, and D. Ungar. Optimizing dynamicallytyped object-oriented languages with polymorphic inline caches. In P. America, editor, Proc. ECOOP'91, LNCS 512, pages 21--38. Springer, 1991. Google Scholar
Digital Library
- R. Jones and R. Lins. Garbage Collection. Wiley, 1996.Google Scholar
- A. Kennedy and D. Syme. Design and implementation of generics for the .NET Common Language Runtime. In Proc. ACM PLDI'01, pages 1--12. ACM Press, 2001. Google Scholar
Digital Library
- S. B. Lippman. Inside the C++ Object Model. Addison-Wesley, New York, 1996. Google Scholar
Digital Library
- B. Meyer. Eiffel: The Language. Prentice-Hall, 1992. Google Scholar
Digital Library
- B. Meyer. Object-Oriented Software Construction. Prentice-Hall, second edition, 1997. Google Scholar
Digital Library
- F. Morandat, R. Ducournau, and J. Privat. Evaluation de l'efficacité des implémentations de l'héritage multiple en typage statique. In B. Carré and O. Zendra, editors, Actes LMO'2009, pages 17--32. Cépaduès, 2009.Google Scholar
- H. Mössenböck. Object-Oriented Programming in Oberon-2. Springer, 1993. Google Scholar
Digital Library
- S. Muthukrishnan and M. Muller. Time and space efficient method lookup for object-oriented languages. In Proc. ACM-SIAM Symp. on Discrete Algorithms, pages 42--51. ACM/SIAM, 1996. Google Scholar
Digital Library
- A. Myers. Bidirectional object layout for separate compilation. In Proc. OOPSLA'95, SIGPLAN Notices, 30(10), pages 124--139. ACM Press, 1995. Google Scholar
Digital Library
- M. Odersky and P. Wadler. Pizza into Java: Translating theory into practice. In Proc. POPL'97, pages 146--159. ACM Press, 1997. Google Scholar
Digital Library
- K. Palacz and J. Vitek. Java subtype tests in real-time. In L. Cardelli, editor, Proc. ECOOP'2003, LNCS 2743, pages 378--404. Springer, 2003.Google Scholar
- J. Privat and R. Ducournau. Link-time static analysis for efficient separate compilation of object-oriented languages. In ACM Workshop on Prog. Anal. Soft. Tools Engin. (PASTE'05), pages 20--27, 2005. Google Scholar
Digital Library
- W. Pugh and G. Weddell. Two-directional record layout for multiple inheritance. In Proc. PLDI'90, ACM SIGPLAN Notices, 25(6), pages 85--91, 1990. Google Scholar
Digital Library
- O. Shivers. Control-Flow Analysis of Higher-Order Languages. PhD thesis, Carnegie Mellon University, 1991. Google Scholar
Digital Library
- R. Sprugnoli. Perfect hashing functions: a single probe retrieving method for static sets. Comm. ACM, 20(11):841--850, 1977. Google Scholar
Digital Library
- G.L. Steele. Common Lisp, the Language. Digital Press, second edition, 1990. Google Scholar
Digital Library
- P. F. Sweeney and M. G. Burke. Quantifying and evaluating the space overhead for alternative C++ memory layouts. Softw., Pract. Exper., 33(7):595--636, 2003. Google Scholar
Digital Library
- S. T. Taft, R. A. Duff, R. L. Brukardt, E. Ploedereder, and P. Leroy, editors. Ada 2005 Reference Manual: Language and Standard Libraries. LNCS 4348. Springer, 2006. Google Scholar
Digital Library
- F. Tip and P. F. Sweeney. Class hierarchy specialization. Acta Informatica, 36(12):927--982, 2000. Google Scholar
Digital Library
- J. Vitek, R.N. Horspool, and A. Krall. Efficient type inclusion tests. In Proc. OOPSLA'97, SIGPLAN Notices, 32(10), pages 142--157. ACM Press, 1997. Google Scholar
Digital Library
- O. Zendra, D. Colnet, and S. Collin. Efficient dynamic dispatch without virtual function tables: The SmallEiffel compiler. In Proc. OOPSLA'97, SIGPLAN Notices, 32(10), pages 125--141. ACM Press, 1997. Google Scholar
Digital Library
- Y. Zibin and J. Gil. Two-dimensional bi-directional object layout. In L. Cardelli, editor, Proc. ECOOP'2003, LNCS 2743, pages 329--350. Springer, 2003.Google Scholar
Index Terms
Empirical assessment of object-oriented implementations with multiple inheritance and static typing
Recommendations
Implementing statically typed object-oriented programming languages
Object-oriented programming represents an original implementation issue due to its philosophy of making the program behavior depend on the dynamic type of objects. This is expressed by the late binding mechanism, aka message sending. The underlying ...
Perfect hashing as an almost perfect subtype test
Subtype tests are an important issue in the implementation of object-oriented programming languages. Many techniques have been proposed, but none of them perfectly fulfills the five requirements that we have identified: constant-time, linear-space, ...
Empirical assessment of object-oriented implementations with multiple inheritance and static typing
OOPSLA '09: Proceedings of the 24th ACM SIGPLAN conference on Object oriented programming systems languages and applicationsObject-oriented languages involve a threefold tradeoff between runtime efficiency, expressiveness (multiple inheritance), and modularity, i.e. open-world assumption (OWA). Runtime efficiency is conditioned by both the implementation technique and ...







Comments