Performance Issues with Implicit Resolution in Scala

Gergely Nagy, Zoltán Porkoláb · 2018

Scala is an emerging programming language that supports multiple programming paradigms.It has been designed to support high levels of expressiveness and to allow writing concise code.To achieve this, it supports many features, including but not limited to macros, DSLs as well as implicit type conversions and implicit argument lists to functions.Due to the wide range of language features and the advanced static type system, the Scala compiler possesses a non-trivial implementation.We have analyzed the performance characteristics of the compiler and have found that the major part of compilation time is spent on typing syntax trees.This includes implicit resolution, thus we have focused our efforts on investigating this specific language feature.We have analyzed how typical usage patterns that involve implicit resolution affect compilation times.Based on this analysis we have managed to assemble a list of recommendations for programming style and code management that allow programmers to leverage implicits to their full potential, but lead to drastically reduced compilation times.

Read the paper · More papers on PaperTik