Improving the Performance of Scala Collections with Miniboxing
Using generics, Scala collections can be used to store different types of data in a type-safe manner. Unfortunately, due to the erasure transformation, the performance of generics is degraded when storing primitive types, such as integers and floating point numbers. Miniboxing is a novel translation for generics that restores primitive type performance. Naturally, a good choice would be to use miniboxing to translate Scala collections. In this paper we explore the patterns used to implement the Scala collections, describe how they are transformed by miniboxing and finally compare the performance of the two transformations on a mockup of the Scala collection library. The benchmarks show our prototype implementation (http://scala-miniboxing.org) can speed up collection operations by 45% without any need for programmer intervention.
mbox2-trans-big.gif
openaccess
308.13 KB
GIF
06e8ccb557f8b2415a66576182d47853
miniboxing-collections.pdf
openaccess
85.24 KB
Adobe PDF
4a864849df0a5af4bbd9db6c28ce754d