Lightbend

Scala Days 2014 - "Lightning-Fast Standard Collections With ScalaBlitz"


Listen Later

As a typical representative of highly abstract Scala libraries, standard collection library faces a number of performance challenges that arise when genericity and high-order code meet the JVM. In particular, commonly used standard Scala collections operations such as 'reduce', 'map', 'filter' suffer huge slowdowns in comparison with equivalent Java code because of abundant boxing and HotSpot-unfriendly code patterns.
One of the standard approaches to performance-critical design in Scala is eschewing high-level abstractions and churning low-level code with predictable performance characteristics. However, the advent of macros in Scala 2.10 enables a better opportunity that we've seized in ScalaBlitz, a library of highly optimized collection operations. The best thing about this approach is that you don't need to rewrite your code to get advantages.
In ScalaBlitz, we have written a macro that inlines and specializes operations on Scala collections, turning high-level abstractions into fine-tuned, performant code. This decreases memory pressure and provides speedups(ie up to 30x for Range.reduce) all that while retaining the conventional, compatible interface of standard collections.
In this talk we will identify the most common pitfalls that prevent vanilla collections from being fast and explain how we dealt with them. We will show how using ScalaBlitz can help you achieve better performance, while continuing to write code against the familiar interface.
Dmytro Petrashko is a programming languages and algorithms researcher and a doctoral assistant at EPFL. He is currently working on a doctorate as a research assistant in the School of Computer and Communication Sciences at the EPFL in Switzerland, in the LAMP laboratory on Scala development under the supervision of Dr. Martin Odersky. Prior to that, he received his Bachelor degree at the Moscow Institute of Physics and Technology. His research interests include parallel and concurrent data structures, I/O efficient algorithms as well as design and implementation of frameworks, languages and tools for data-intensive software development.
To view the video visit www.parleys.com.
Build Reactive Apps - Get started at www.typesafe.com/activator.
...more
View all episodesView all episodes
Download on the App Store

LightbendBy Lightbend