TY - JOUR A1 - Pape, Tobias A1 - Felgentreff, Tim A1 - Hirschfeld, Robert A1 - Gulenko, Anton A1 - Bolz, Carl Friedrich T1 - Language-independent Storage Strategies for Tracing-JIT-based Virtual Machines JF - ACM SIGPLAN notices N2 - Storage strategies have been proposed as a run-time optimization for the PyPy Python implementation and have shown promising results for optimizing execution speed and memory requirements. However, it remained unclear whether the approach works equally well in other dynamic languages. Furthermore, while PyPy is based on RPython, a language to write VMs with reusable components such as a tracing just-in-time compiler and garbage collection, the strategies design itself was not generalized to be reusable across languages implemented using that same toolchain. In this paper, we present a general design and implementation for storage strategies and show how they can be reused across different RPython-based languages. We evaluate the performance of our implementation for RSqueak, an RPython-based VM for Squeak/Smalltalk and show that storage strategies may indeed off er performance benefits for certain workloads in other dynamic programming languages. We furthermore evaluate the generality of our implementation by applying it to Topaz, a Ruby VM, and Pycket, a Racket implementation. KW - Implementation KW - collection types KW - memory optimization KW - dynamic typing Y1 - 2016 U6 - https://doi.org/10.1145/2816707.2816716 SN - 0362-1340 SN - 1558-1160 VL - 51 SP - 104 EP - 113 PB - Association for Computing Machinery CY - New York ER - TY - BOOK A1 - Wassermann, Lars A1 - Felgentreff, Tim A1 - Pape, Tobias A1 - Bolz, Carl Friedrich A1 - Hirschfeld, Robert T1 - Tracing Algorithmic Primitives in RSqueak/VM N2 - When realizing a programming language as VM, implementing behavior as part of the VM, as primitive, usually results in reduced execution times. But supporting and developing primitive functions requires more effort than maintaining and using code in the hosted language since debugging is harder, and the turn-around times for VM parts are higher. Furthermore, source artifacts of primitive functions are seldom reused in new implementations of the same language. And if they are reused, the existing API usually is emulated, reducing the performance gains. Because of recent results in tracing dynamic compilation, the trade-off between performance and ease of implementation, reuse, and changeability might now be decided adversely. In this work, we investigate the trade-offs when creating primitives, and in particular how large a difference remains between primitive and hosted function run times in VMs with tracing just-in-time compiler. To that end, we implemented the algorithmic primitive BitBlt three times for RSqueak/VM. RSqueak/VM is a Smalltalk VM utilizing the PyPy RPython toolchain. We compare primitive implementations in C, RPython, and Smalltalk, showing that due to the tracing just-in-time compiler, the performance gap has lessened by one magnitude to one magnitude. N2 - Wenn man eine Programmiersprache als Virtuelle Maschine (VM) realisiert, dann wird Verhalten, das man als Teil der VM, also primitiv, implementiert normalerweise schneller ausgeführt, als vergleichbare Funktionen die in der implementierten Sprache verfasst wurden. Aber die Entwicklung und Wartung von primitiven Funktionen erfordert mehr Anstrengung als die Wartung und Benutzung von Funktionen der implementierten Sprache, da Fehlerbehebung schwerer ist, und die Entwicklungszyklen für VM-Teile länger sind. Im Gegensatz zu Programmen, die in der implementierten Programmiersprache geschrieben sind, wird Quelltext von Primitiven selten wiederverwendet. Und falls sie wiederverwendet werden, dann wird die Schnittstelle zur VM meist emuliert, was den Geschwindigkeitsvorteil reduziert. Aber aufgrund von neueren Resultaten der ablaufverfolgenden dynamischen Kompilierung, könnte die Abwägung zwischen Geschwindigkeit einerseits und Implementierungsaufwand, Wiederverwendbarkeit und Änderbarkeit andererseits nun zugunsten von letzteren ausfallen. In dieser Arbeit untersuchen wir, welche Abstriche bei der Implementierung von Verhalten als Primitive gemacht werden müssen, insbesondere wie hoch die Laufzeitunterschiede zwischen Primitiven und gehosteten Funktionen noch sind. Um das zu erreichen haben wir die algorithmische Primitive BitBlt drei mal für RSqueak/VM implementiert. RSqueak/VM ist eine Smalltalk VM, die die PyPy RPython-Toolkette verwendet. Wir vergleichen die Primitivenimplementierungen in C, RPython und Smalltalk, und zeigen, dass aufgrund eines ablaufverfolgenden just-in-time-Übersetzers der Geschwindigkeitsunterschied um eine Größenordnung auf eine Größenordnung gefallen ist. T3 - Technische Berichte des Hasso-Plattner-Instituts für Digital Engineering an der Universität Potsdam - 104 KW - virtual machines KW - collection types KW - memory optimization KW - dynamic typing KW - virtuelle Maschinen KW - Sammlungsdatentypen KW - Speicheroptimierungen KW - dynamische Sprachen Y1 - 2016 U6 - http://nbn-resolving.de/urn/resolver.pl?urn:nbn:de:kobv:517-opus4-91277 SN - 978-3-86956-355-8 SN - 1613-5652 SN - 2191-1665 IS - 104 PB - Universitätsverlag Potsdam CY - Potsdam ER -