ABSTRACT
Presizing and pretransitioning are run-time optimizations that reduce reallocations of lists. These two optimizations have previously been implemented (together with pretenuring) using Mementos in the V8 Javascript engine. The design of Mementos, however, relies on the support of the garbage collector (GC) of the V8 runtime system.
In contrast to V8, dynamic language runtimes written for the GraalVM do not have access to the GC. Thus, the prior work cannot be applied directly. Instead, an alternative implementation approach without reliance on the GC is needed and poses different challenges.
In this paper we explore and analyze an approach for implementing these two optimizations in the context of GraalVM, using the Python implementation for GraalVM as an example. We substantiate these thoughts with rough performance numbers taken from our prototype on which we tested different presizing strategies.
- Carl Friedrich Bolz, Antonio Cuni, Maciej Fijalkowski, Michael Leuschel, Samuele Pedroni, and Armin Rigo. 2011. Allocation Removal by Partial Evaluation in a Tracing JIT. In Proceedings of the 20th ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation. ACM, 43–52.Google ScholarDigital Library
- Carl Friedrich Bolz, Lukas Diekmann, and Laurence Tratt. 2013. Storage Strategies for Collections in Dynamically Typed Languages. In ACM SIGPLAN Notices, Vol. 48. ACM, 167–182.Google ScholarDigital Library
- Daniel Clifford, Hannes Payer, Michael Stanton, and Ben L Titzer. 2015. Memento Mori: Dynamic Allocation-site-based Optimizations. In ACM SIGPLAN Notices, Vol. 50. ACM, 105–117.Google Scholar
- Bjorn N Freeman-Benson and John Maloney. 1989. The DeltaBlue Algorithm: An Incremental Constraint Hierarchy Solver. In Eighth Annual International Phoenix Conference on Computers and Communications. 1989 Conference Proceedings. IEEE, 538–542.Google Scholar
- Andreas Gal, Brendan Eich, Mike Shaver, David Anderson, David Mandelin, Mohammad R Haghighat, Blake Kaplan, Graydon Hoare, Boris Zbarsky, Jason Orendorff, et al. 2009. Trace-based Just-in-time Type Specialization for Dynamic Languages. In ACM Sigplan Notices, Vol. 44. ACM, 465–478.Google ScholarDigital Library
- Matthias Grimmer, Stefan Marr, Mario Kahlhofer, Christian Wimmer, Thomas Würthinger, and Hanspeter Mössenböck. 2017. Applying Optimizations for Dynamically-typed Languages to Java. In Proceedings of the 14th International Conference on Managed Languages and Runtimes. ACM, 12–22.Google ScholarDigital Library
- Stefan Marr, Benoit Daloze, and Hanspeter Mössenböck. 2016. Cross-language Compiler Benchmarking: Are We Fast Yet?. In ACM SIGPLAN Notices, Vol. 52. ACM, 120–131.Google ScholarDigital Library
- Fabio Niephaus, Tim Felgentreff, and Robert Hirschfeld. 2019. GraalSqueak: Toward a Smalltalk-Based Tooling Platform for Polyglot Programming. In Proceedings of the 16th ACM SIGPLAN International Conference on Managed Programming Languages and Runtimes (MPLR 2019). Association for Computing Machinery, New York, NY, USA, 14–26.Google ScholarDigital Library
- Tobias Pape, Tim Felgentreff, Robert Hirschfeld, Anton Gulenko, and Carl Friedrich Bolz. 2015. Language-independent Storage Strategies for Tracing-JIT-based Virtual Machines. In ACM SIGPLAN Notices, Vol. 51. ACM, 104–113.Google ScholarDigital Library
- Thomas Würthinger, Christian Wimmer, Andreas Wöß, Lukas Stadler, Gilles Duboscq, Christian Humer, Gregor Richards, Doug Simon, and Mario Wolczko. 2013. One VM to Rule Them All. In Proceedings of the 2013 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming & Software. ACM, 187–204.Google ScholarDigital Library
Index Terms
- Toward presizing and pretransitioning strategies for GraalPython
Recommendations
Multi-language dynamic taint analysis in a polyglot virtual machine
MPLR '20: Proceedings of the 17th International Conference on Managed Programming Languages and RuntimesDynamic taint analysis is a popular program analysis technique in which sensitive data is marked as tainted and the propagation of tainted data is tracked in order to determine whether that data reaches critical program locations. This analysis ...
GraalVM: metaprogramming inside a polyglot system (invited talk)
META 2018: Proceedings of the 3rd ACM SIGPLAN International Workshop on Meta-Programming Techniques and ReflectionGraalVM is a polyglot virtual machine for running applications written in a variety of languages such as JavaScript, Ruby, Python, R, JVM-based languages like Java, Scala, Kotlin, and LLVM-based languages such as C and C++.
GraalVM enables ...
Debugging native extensions of dynamic languages
ManLang '18: Proceedings of the 15th International Conference on Managed Languages & RuntimesMany dynamic programming languages such as Ruby and Python enable developers to use so called native extensions, code implemented in typically statically compiled languages like C and C++. However, debuggers for these dynamic languages usually lack ...
Comments