000150270 001__ 150270
000150270 005__ 20190619003302.0
000150270 0247_ $$2doi$$a10.5075/epfl-thesis-4820
000150270 02470 $$2urn$$aurn:nbn:ch:bel-epfl-thesis4820-5
000150270 02471 $$2nebis$$a6122055
000150270 037__ $$aTHESIS
000150270 041__ $$aeng
000150270 088__ $$a4820
000150270 245__ $$aCompiling Scala for Performance
000150270 269__ $$a2010
000150270 260__ $$bEPFL$$c2010$$aLausanne
000150270 300__ $$a133
000150270 336__ $$aTheses
000150270 520__ $$aScala is a new programming language bringing together object-oriented and functional programming. Its defining features are uniformity and extensibility. Scala offers great flexibility for programmers, allowing them to grow the language through libraries. Oftentimes what seems like a language feature is in fact implemented in a library, effectively giving programmers the power of language designers. The downside of this flexibility is that familiar looking code may hide unexpected performance costs. It is important for Scala compilers to bring down this cost as much as possible. We identify several areas of impact for Scala performance: higher-order functions and closures, and generic containers used with primitive types. We present two complementary approaches for improving performance in these areas: optimizations and specialization. Compiler optimization can bring down the cost through a combination of aggressive inlining of higher-order functions, an extended version of copy-propagation and dead-code elimination. Both anonymous functions and boxing can be eliminated by this approach. We show on a number of benchmarks that these language features can be up to 5 times faster when properly optimized, on current day JVMs. We propose a new approach to compiling parametric polymorphism for performance at primitive types. We mix a homogeneous translation scheme with user-directed specialization for primitive types. Type parameters may be annotated to require specialization of code depending on them. We propose definition-site specialization for primitive types, achieving separate compilation and no boxing when both the definition and call site are specialized. Specialized classes are compatible with unspecialized code, and specialization agnostic code can work with specialized instances, meaning that specialization is opportunistic. We present a formalism of a small subset of Scala with specialization and prove that specialization preserves types. We implemented this translation in the Scala compiler and report on improvements on a set of benchmarks, showing that specialization can make programs more than two times faster.
000150270 6531_ $$acompiler
000150270 6531_ $$aoptimization
000150270 6531_ $$aparametric polymorphism
000150270 6531_ $$agenerics
000150270 6531_ $$aspecialization
000150270 6531_ $$aboxing
000150270 6531_ $$aScala
000150270 700__ $$0241949$$g162914$$aDragos, Iulian
000150270 720_2 $$aOdersky, Martin$$edir.$$g126003$$0241835
000150270 8564_ $$uhttps://infoscience.epfl.ch/record/150270/files/EPFL_TH4820.pdf$$zTexte intégral / Full text$$s1067348$$yTexte intégral / Full text
000150270 909C0 $$xU10409$$0252187$$pLAMP
000150270 909CO $$pthesis-public$$pDOI$$pIC$$ooai:infoscience.tind.io:150270$$qGLOBAL_SET$$pthesis$$pthesis-bn2018$$qDOI2
000150270 918__ $$dEDIC2005-2015$$cIIF$$aIC
000150270 919__ $$aLAMP1
000150270 920__ $$b2010
000150270 970__ $$a4820/THESES
000150270 973__ $$sPUBLISHED$$aEPFL
000150270 980__ $$aTHESIS