skip to main content
research-article

Optimizing dynamic dispatch with fine-grained state tracking

Published:18 October 2010Publication History
Skip Abstract Section

Abstract

Dynamic mixin is a construct available in Ruby and other dynamic languages. It can be used as a base to implement a range of programming paradigms, such as dynamic aspect-oriented programming and context-oriented programming. However, the performance characteristics of current implementation of dynamic mixin in Ruby leaves much to be desired under condition of frequent dynamic mixin operations, global method cache and inline cache misses incur significant overhead. In this work we implemented fine-grained state tracking for CRuby 1. and were able to improve performance by more than six times on the microbenchmark exercising extreme case flowing 4 times to global method cache clearing, 28% to fine-grained state tracking and further 12% to inline cache miss elimination by caching alternating states. We demonstrated a small application using dynamic mixins that gets 48% improvement in performance from our techniques. We also implemented in C a more general delegation object models and proposed an algorithm of thread-local caching, which allows to reduce inline cache misses while permitting thread-local delegation changes.

References

  1. }}G. Bracha and W. Cook. Mixin-based inheritance. In Proceedings OOPSLA/ECOOP '91, LNCS 512, pages 303--311. ACM, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. }}C. Chambers, D. Ungar, and E. Lee. An efficient implementation of self, a dynamically-typed object-oriented language based on prototypes. LISP and Symbolic Computation, 4 (3): 243--281, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. }}C. Chambers, J. Dean, and D. Grove. A framework for selective recompilation in the presence of complex intermodule dependencies. Software Engineering, International Conference on, 0: 221, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. }}D. Chisnall. Updating objective-c. Technical report, Swansea University, 2008.Google ScholarGoogle Scholar
  5. }}D. Chisnall. A modern objective-c runtime. Journal of Object Technology, 8 (1): 221--240, Jan 2009.Google ScholarGoogle ScholarCross RefCross Ref
  6. }}B. Cox and A. Novobilski. Object-oriented programming: an evolutionary approach. Addison-Wesley, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. }}D. Detlefs and O. Agesen. Inlining of virtual methods. In Proceedings ECOOP '99, LNCS 1628, pages 258--277, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. }}L. P. Deutsch and A. M. Schiffman. Efficient implementation of the smalltalk-80 system. In POPL '84: Proceedings of the 11th ACM SIGACT-SIGPLAN symposium on Principles of programming languages, pages 297--302, New York, NY, USA, 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. }}M. Furr, J.-h. D. An, and J. S. Foster. Profile-guided static typing for dynamic scripting languages. In OOPSLA '09: Proceeding of the 24th ACM SIGPLAN conference on Object oriented programming systems languages and applications, pages 283--300, New York, NY, USA, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. }}N. Grcevski, A. Kielstra, K. Stoodley, M. Stoodley, and V. Sundaresan. Java just-in-time compiler and virtual machine improvements for server and middleware applications. In 3rd Virtual Machine Research and Technology Symposium (VM), 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. }}M. Haupt and H. Schippers. A machine model for aspect-oriented programming. In Proceedings ECOOP '09, LNCS 4609, pages 501--524, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. }}R. Hirschfeld, P. Costanza, and O. Nierstrasz. Context-oriented programming. Journal of Object Technology, 7 (3): 125--151, 2008.Google ScholarGoogle ScholarCross RefCross Ref
  13. }}G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. Griswold. An overview of AspectJ. In Proceedings ECOOP '01, LNCS 2072, pages 327--354, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. }}enböck, Rodriguez, Russell, and Cox}hotspot6T. Kotzmann, C. Wimmer, H. Mössenböck, T. Rodriguez, K. Russell, and D. Cox. Design of the java HotSpot™ client compiler for java 6. ACM Trans. Archit. Code Optim., 5 (1): 1--32, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. }}G. Krasner, editor. Smalltalk-80: bits of history, words of advice. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. }}H. Lieberman. Using prototypical objects to implement shared behavior in object-oriented systems. ACM SIGPLAN Notices, 21 (11): 214--223, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. }}I. Piumarta and A. Warth. Open, extensible object models. Self-Sustaining Systems, 5146: 1--30, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. }}A. Popovici, T. Gross, and G. Alonso. Dynamic weaving for aspect-oriented programming. In AOSD '02: Proceedings of the 1st international conference on Aspect-oriented software development, pages 141--147, New York, NY, USA, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. }}K. Sasada. Efficient implementation of Ruby virtual machine. PhD thesis, The University of Tokyo, Graduate school of information science and technology, 2007. In japanese language.Google ScholarGoogle Scholar
  20. }}H. Schippers, M. Haupt, and R. Hirschfeld. An implementation substrate for languages composing modularized crosscutting concerns. In Proceedings of the 2009 ACM symposium on Applied Computing, pages 1944--1951. ACM New York, NY, USA, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. }}et al.(2009)Villazón, Binder, Ansaloni, and Moret}hotwaveA. Villazón, W. Binder, D. Ansaloni, and P. Moret. Hotwave: creating adaptive tools with dynamic aspect-oriented programming in java. In Proceedings GPCE '09: Proceedings of the eighth international conference on Generative programming and component engineering, pages 95--98. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. }}J. Vitek and R. Horspool. Compact dispatch tables for dynamically typed object oriented languages. In Compiler Construction '96, LNCS 1060, pages 309--325. Springer, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Optimizing dynamic dispatch with fine-grained state tracking

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 45, Issue 12
        DLS '10
        December 2010
        107 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1899661
        Issue’s Table of Contents
        • cover image ACM Conferences
          DLS '10: Proceedings of the 6th symposium on Dynamic languages
          October 2010
          120 pages
          ISBN:9781450304054
          DOI:10.1145/1869631

        Copyright © 2010 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 18 October 2010

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!