Repository logo

Infoscience

  • English
  • French
Log In
Logo EPFL, École polytechnique fédérale de Lausanne

Infoscience

  • English
  • French
Log In
  1. Home
  2. Academic and Research Output
  3. Conferences, Workshops, Symposiums, and Seminars
  4. Bridging Islands of Specialized Code using Macros and Reified Types
 
conference paper

Bridging Islands of Specialized Code using Macros and Reified Types

Stucki, Nicolas
•
Ureche, Vlad  
2013
Proceedings of the 4th Workshop on Scala - SCALA '13
The 4th Workshop on Scala

Parametric polymorphism in Scala suffers from the usual drawback of erasure on the Java Virtual Machine: primitive values are boxed, leading to indirect access, wasteful use of heap memory and lack of cache locality. For performance-critical parts of the code, the Scala compiler introduces specialization, a transformation that duplicates and adapts the bodies of classes and methods for primitive types. Specializing code can speed up execution by an order of magnitude, but only if the code is called from monomorphic sites or from other specialized code. Still, if these “islands” of specialized code are called from generic code, their performance becomes similar to that of generic code, losing optimality. To address this, our project builds high performance “bridges” between “islands” of specialized code, removing the requirement that full traces need to be specialized: We use macros to delimit performance-critical “gaps” between specialized code, which we also specialize. We then use reified types to dispatch the correct specialized variant, thus recovering performance across the “islands”. Our transformation obtains speedups up to 30x and around 12x in average compared to generic only code, by enabling specialization to completely remove boxing and reach its full potential

  • Files
  • Details
  • Metrics
Loading...
Thumbnail Image
Name

scala-brigding-islands.pdf

Access type

openaccess

Size

224.77 KB

Format

Adobe PDF

Checksum (MD5)

ead3673872ea4eb463f45cccf18ae2d2

Logo EPFL, École polytechnique fédérale de Lausanne
  • Contact
  • infoscience@epfl.ch

  • Follow us on Facebook
  • Follow us on Instagram
  • Follow us on LinkedIn
  • Follow us on X
  • Follow us on Youtube
AccessibilityLegal noticePrivacy policyCookie settingsEnd User AgreementGet helpFeedback

Infoscience is a service managed and provided by the Library and IT Services of EPFL. © EPFL, tous droits réservés