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 codebases built in dynamic languages.
%0 Conference Paper
%1 Kaleba:2022:CallSites
%A Kaleba, Sophie
%A Larose, Octave
%A Jones, Richard
%A Marr, Stefan
%B Proceedings of the 18th Symposium on Dynamic Languages
%D 2022
%I ACM
%K Analysis CallSite DynamicLanguages Inlining LookupCache MeMyPublication Splitting myown
%P 14
%R 10.1145/3563834.3567538
%T Who You Gonna Call: Analyzing the Run-time Call-Site Behavior of Ruby Applications
%X 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 codebases built in dynamic languages.
@inproceedings{Kaleba:2022:CallSites,
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 codebases built in dynamic languages.},
acceptancerate = {0.4},
added-at = {2022-10-19T02:12:42.000+0200},
author = {Kaleba, Sophie and Larose, Octave and Jones, Richard and Marr, Stefan},
biburl = {https://www.bibsonomy.org/bibtex/2c190a1ac004e31c2bc2196c17c3dac5f/gron},
blog = {https://stefan-marr.de/2022/11/how-effective-are-classic-lookup-optimizations-for-rails-apps/},
booktitle = {Proceedings of the 18th Symposium on Dynamic Languages},
day = 7,
doi = {10.1145/3563834.3567538},
interhash = {f6bd800f839d062331f82fba580248eb},
intrahash = {c190a1ac004e31c2bc2196c17c3dac5f},
keywords = {Analysis CallSite DynamicLanguages Inlining LookupCache MeMyPublication Splitting myown},
location = {Auckland, New Zealand},
month = {December},
note = {(acceptance rate 40%)},
pages = 14,
pdf = {https://stefan-marr.de/downloads/dls22-kaleba-et-al-analyzing-the-run-time-call-site-behavior-of-ruby-applications.pdf},
publisher = {ACM},
series = {DLS'22},
timestamp = {2023-06-06T17:26:25.000+0200},
title = {Who You Gonna Call: Analyzing the Run-time Call-Site Behavior of Ruby Applications},
year = 2022
}