Making Collection Operations Optimal with Aggressive JIT Compilation
Functional collection combinators are a neat and widely accepted data processing abstraction. However, their generic nature results in high abstraction overheads – Scala collections are known to be notoriously slow for typical tasks. We show that proper optimizations in a JIT compiler can widely eliminate overheads imposed by these abstractions. Using the open-source Graal JIT compiler, we achieve speedups of up to 20x on collection workloads compared to the standard HotSpot C2 compiler. Consequently, a sufficiently aggressive JIT compiler allows the language compiler, such as Scalac, to focus on other concerns.
In this paper, we show how optimizations, such as inlining, polymorphic inlining, and partial escape analysis, are combined in Graal to produce collections code that is optimal with respect to manually written code, or close to optimal. We argue why some of these optimizations are more effectively done by a JIT compiler. We then identify specific use-cases that most current JIT compilers do not optimize well, warranting special treatment from the language compiler.
Sun 22 OctDisplayed time zone: Tijuana, Baja California change
13:30 - 15:00
CompilationScala 2017 at Regency C
Chair(s): Paolo G. Giarrusso University of Tübingen, Germany
|A Scala Framework for Supercompilation|
|Making Collection Operations Optimal with Aggressive JIT Compilation|
Aleksandar Prokopec Oracle Labs, David Leopoldseder Johannes Kepler University Linz, Gilles Duboscq Oracle Labs, Thomas Wuerthinger Oracle LabsDOI
|ScalaSMT: Satisfiability Modulo Theory in Scala (Tool Paper)|
Franck Cassez Macquarie University, Australia, Anthony Sloane Macquarie UniversityDOI