[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.1145/3563834.3567538acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Who You Gonna Call: Analyzing the Run-Time Call-Site Behavior of Ruby Applications

Published: 01 December 2022 Publication History

Abstract

Applications written in dynamic languages are becoming larger and larger and companies increasingly use multi-million line codebases in production. At the same time, dynamic languages rely heavily on dynamic optimizations, particularly those that reduce the overhead of method calls. In this work, we study the call-site behavior of Ruby benchmarks that are being used to guide the development of upcoming Ruby implementations such as TruffleRuby and YJIT. We study the interaction of call-site lookup caches, method splitting, and elimination of duplicate call-targets. We find that these optimizations are indeed highly effective on both smaller and large benchmarks, methods and closures alike, and help to open up opportunities for further optimizations such as inlining. However, we show that TruffleRuby’s splitting may be applied too aggressively on already-monomorphic call-sites, coming at a run-time cost. We also find three distinct patterns in the evolution of call-site behavior over time, which may help to guide novel optimizations. We believe that our results may support language implementers in optimizing runtime systems for large code-bases built in dynamic languages.

References

[1]
Beatrice Åkerblom, Jonathan Stendahl, Mattias Tumlin, and Tobias Wrigstad. 2014. Tracing Dynamic Features in Python Programs. In Proceedings of the 11th Working Conference on Mining Software Repositories (MSR 2014). Association for Computing Machinery, New York, NY, USA. 292–295. isbn:9781450328630 https://doi.org/10.1145/2597073.2597103
[2]
Beatrice Åkerblom and Tobias Wrigstad. 2015. Measuring Polymorphism in Python Programs. SIGPLAN Not., 51, 2 (2015), oct, 114–128. issn:0362-1340 https://doi.org/10.1145/2936313.2816717
[3]
Michael Bächle and Paul Kirchberg. 2007. Ruby on Rails. IEEE software, 24, 6 (2007), 105–108.
[4]
Maxime Chevalier-Boisvert, Noah Gibbs, Jean Boussier, Si Xing (Alan) Wu, Aaron Patterson, Kevin Newton, and John Hawthorn. 2021. YJIT: A Basic Block Versioning JIT Compiler for CRuby. In Proceedings of the 13th ACM SIGPLAN International Workshop on Virtual Machines and Intermediate Languages (VMIL’21). Association for Computing Machinery, New York, NY, USA. 25–32. isbn:9781450391092 https://doi.org/10.1145/3486606.3486781
[5]
Benoit Daloze, Arie Tal, Stefan Marr, Hanspeter Mössenböck, and Erez Petrank. 2018. Parallelization of Dynamic Languages: Synchronizing Built-in Collections. Proceedings of the ACM on Programming Languages, 2, OOPSLA (2018), Nov., 108:1–108:30. https://doi.org/10.1145/3276478
[6]
Olivier Flückiger, Guido Chari, Ming-Ho Yee, Jan Ječmen, Jakob Hain, and Jan Vitek. 2020. Contextual Dispatch for Function Specialization. Proc. ACM Program. Lang., 4, OOPSLA (2020), Article 220, nov, 24 pages. https://doi.org/10.1145/3428288
[7]
Adele Goldberg and David Robson. 1983. Smalltalk-80: the language and its implementation. Addison-Wesley Longman Publishing Co., Inc.
[8]
Alex Holkner and James Harland. 2009. Evaluating the Dynamic Behaviour of Python Applications. In Proceedings of the Thirty-Second Australasian Conference on Computer Science - Volume 91 (ACSC ’09). Australian Computer Society, Inc., AUS. 19–28. isbn:9781920682729 https://doi.org/10.5555/1862659.1862665
[9]
Urs Hölzle, Craig Chambers, and David Ungar. 1991. Optimizing dynamically-typed object-oriented languages with polymorphic inline caches. In European Conference on Object-Oriented Programming. 21–38.
[10]
Ross Ihaka and Robert Gentleman. 1996. R: a language for data analysis and graphics. Journal of Computational and Graphical Statistics, 5, 3 (1996), 299–314.
[11]
Sophie Kaleba, Octave Larose, Richard Jones, and Stefan Marr. 2022. Appendices - Who You Gonna Call: Analyzing the Run-Time Call-Site Behavior of Ruby Applications. https://doi.org/10.5281/zenodo.7319817
[12]
Thomas Kistler and Michael Franz. 2003. Continuous program optimization: A case study. ACM Transactions on Programming Languages and Systems, 25, 4 (2003), July, 500–548. issn:0164-0925 https://doi.org/10.1145/778559.778562
[13]
Stefan Marr, Benoit Daloze, and Hanspeter Mössenböck. 2016. Cross-Language Compiler Benchmarking—Are We Fast Yet? In Proceedings of the 12th Symposium on Dynamic Languages (DLS’16). ACM, 120–131. isbn:978-1-4503-4445-6 https://doi.org/10.1145/2989225.2989232
[14]
Yukio Matsumoto and Kiju Ishituka. 2002. Ruby programming language.
[15]
Priya Nagpurkar. 2007. Analysis, Detection, and Exploitation of Phase Behavior in Java Programs. Ph. D. Dissertation. University of California Santa Barbara.
[16]
E. Perelman, M. Polito, J.-Y. Bouguet, J. Sampson, B. Calder, and C. Dulong. 2006. Detecting phases in parallel applications on shared memory architectures. In Proceedings 20th IEEE International Parallel & Distributed Processing Symposium. IEEE, Rhodes Island, Greece. 10 pp. isbn:978-1-4244-0054-6 https://doi.org/10.1109/IPDPS.2006.1639325
[17]
Gregor Richards, Sylvain Lebresne, Brian Burg, and Jan Vitek. 2010. An Analysis of the Dynamic Behavior of JavaScript Programs. In Proceedings of the 31st ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’10). Association for Computing Machinery, New York, NY, USA. 1–12. isbn:9781450300193 https://doi.org/10.1145/1806596.1806598
[18]
Aibek Sarimbekov, Andrej Podzimek, Lubomir Bulej, Yudi Zheng, Nathan Ricci, and Walter Binder. 2013. Characteristics of Dynamic JVM Languages. In Proceedings of the 7th ACM Workshop on Virtual Machines and Intermediate Languages (VMIL ’13). Association for Computing Machinery, New York, NY, USA. 11–20. isbn:9781450326018 https://doi.org/10.1145/2542142.2542144
[19]
Robert W. Scheifler. 1977. An Analysis of Inline Substitution for a Structured Programming Language. Commun. ACM, 20, 9 (1977), sep, 647–654. issn:0001-0782 https://doi.org/10.1145/359810.359830
[20]
Chris Seaton, Benoit Daloze, Kevin Menard, Petr Chalupa, Brandon Fish, and Duncan MacGregor. 2017. TruffleRuby—A High Performance Implementation of the Ruby Programming Language.
[21]
Thomas Würthinger, Christian Wimmer, Christian Humer, Andreas Wöß, Lukas Stadler, Chris Seaton, Gilles Duboscq, Doug Simon, and Matthias Grimmer. 2017. Practical Partial Evaluation for High-performance Dynamic Language Runtimes. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’17). ACM, 662–676. isbn:978-1-4503-4988-8 https://doi.org/10.1145/3062341.3062381
[22]
Thomas Würthinger, Andreas Wöß, Lukas Stadler, Gilles Duboscq, Doug Simon, and Christian Wimmer. 2012. Self-Optimizing AST Interpreters. In Proceedings of the 8th Dynamic Languages Symposium (DLS’12). ACM, 73–82. isbn:978-1-4503-1564-7 https://doi.org/10.1145/2384577.2384587

Cited By

View all
  • (2024)An Improved Template-Based JIT Compiler for Java2024 34th International Conference on Collaborative Advances in Software and COmputiNg (CASCON)10.1109/CASCON62161.2024.10838016(1-10)Online publication date: 11-Nov-2024
  • (2023)AST vs. Bytecode: Interpreters in the Age of Meta-CompilationProceedings of the ACM on Programming Languages10.1145/36228087:OOPSLA2(318-346)Online publication date: 16-Oct-2023
  • (2023)Evaluating YJIT’s Performance in a Production Context: A Pragmatic ApproachProceedings of the 20th ACM SIGPLAN International Conference on Managed Programming Languages and Runtimes10.1145/3617651.3622982(20-33)Online publication date: 19-Oct-2023
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
DLS 2022: Proceedings of the 18th ACM SIGPLAN International Symposium on Dynamic Languages
November 2022
28 pages
ISBN:9781450399081
DOI:10.1145/3563834
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 December 2022

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. call-site analysis
  2. dynamic languages
  3. inlining
  4. lookup caches
  5. splitting

Qualifiers

  • Research-article

Funding Sources

Conference

DLS '22
Sponsor:

Acceptance Rates

Overall Acceptance Rate 32 of 77 submissions, 42%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)30
  • Downloads (Last 6 weeks)4
Reflects downloads up to 13 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)An Improved Template-Based JIT Compiler for Java2024 34th International Conference on Collaborative Advances in Software and COmputiNg (CASCON)10.1109/CASCON62161.2024.10838016(1-10)Online publication date: 11-Nov-2024
  • (2023)AST vs. Bytecode: Interpreters in the Age of Meta-CompilationProceedings of the ACM on Programming Languages10.1145/36228087:OOPSLA2(318-346)Online publication date: 16-Oct-2023
  • (2023)Evaluating YJIT’s Performance in a Production Context: A Pragmatic ApproachProceedings of the 20th ACM SIGPLAN International Conference on Managed Programming Languages and Runtimes10.1145/3617651.3622982(20-33)Online publication date: 19-Oct-2023
  • (2023)What Types Are Needed for Typing Dynamic Objects? A Python-Based Empirical StudyProgramming Languages and Systems10.1007/978-981-99-8311-7_2(24-45)Online publication date: 26-Nov-2023

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media