Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Bridging islands of specialized code using macros and reified types
Stucki N., Ureche V.  Scala2013 (Proceedings of the 4th Workshop on Scala, Montpellier, France, Jul 2, 2013)1-4.2013.Type:Proceedings
Date Reviewed: Oct 22 2013

Java virtual machines have known problems with heap memory management. Nonavailability of local cache complicates the issue to an extent. This results in performance degradation in many instances, such as during the compilation and execution of generic code in Scala. Specialization is an annotation-driven transformation in the Scala compiler that improves the performance of generic code. When a type parameter in a method or class is annotated, a class is instantiated for the primitive type and the instance is rewritten to use the specialized variant instead of a generic one. This avoids boxing, resulting in a possible reduction of execution speed for generic code by an order of magnitude. This is a duplication of effort and requires a specialized adaptation of the code body for each generic type. Also, invoking the specialization code remains difficult due to issues associated with the redirection required for the use of specialization code and erasure. This creates “islands” of specialization code, breaking optimality into many important use cases.

This paper suggests a technique that uses macros to resolve the issue. The authors assert that the issue can be addressed with specialized code in between the islands by allowing the programmers to select a limited scope of generic code to be specialized. The authors seek to (1) present a transformation to extend the scope of specialization, and (2) provide a benchmark to validate the transformation. The results indicate performance increases of up to 30 times compared to Scala specialized code.

A short introduction to the issues is followed by six sections: “Example,” “Implementation,” “Evaluation,” “Related Work,” “Conclusions,” and “References.” The implementation section describes a macro-based procedure, while the evaluation presents results of runs by the authors for the variable types Int, Double, Boolean, and Generic, for arrays of two million and ten million items. The authors conclude that the proposed transformation is able to build high-performance bridges between specialized code in a generic context. I did not have the resources or opportunity to confirm these results, but if they are correct, the outcomes are quite impressive.

Reviewer:  Anoop Malaviya Review #: CR141660 (1401-0077)
Bookmark and Share
  Reviewer Selected
 
 
Coding Tools and Techniques (D.2.3 )
 
 
Object Representation (E.2 ... )
 
Would you recommend this review?
yes
no
Other reviews under "Coding Tools and Techniques": Date
Typographic style is more than cosmetic
Oman P., Cook C. Communications of the ACM 33(5): 506-520, 1990. Type: Article
Mar 1 1991
Obfuscated C and other mysteries
Libes D., John Wiley & Sons, Inc., New York, NY, 1993. Type: Book (9780471578055)
Aug 1 1993
Writing solid code
Maguire S., Microsoft Press, Redmond, WA, 1993. Type: Book (9781556155512)
Feb 1 1994
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud, Inc.®
Terms of Use
| Privacy Policy