Miniboxing @ Google Summer of Code 2014: Help develop the miniboxing plugin and make it more useful!


Miniboxing is a research project at EPFL aimed at improving the performance of generic code running on the Java Virtual Machine. Unlike Scala specialization, miniboxing sacrifices some of the performance in order to generate less bytecode: indeed, it typically generates 4x-20x less bytecode. Miniboxing is implemented as a Scala compiler plugin, and can speed up generics by up to 22x when used for numeric types, such as integer or double.

Please keep in mind that the miniboxing plugin is an alpha release, and not a feature-complete, perfectly functional drop-in compiler addon. There are many bugs we are working on and known limitations that we haven't addressed yet.

Still, we do our best to make miniboxing a stable transformation, with nightly builds and tens of test cases running every night. That said, miniboxing is a complex transformation, so don't be surprised if the miniboxing plugin to fails on some programs -- and please, file bugs for cases that fail!

Taking ArrayBuffer.reverse as an example:


After removing generic:

And when comparing the total bytecode size for spire we see a 4.5x bytecode reduction:

Using miniboxing is as easy as adding an annotation:

class C[@miniboxed T](val t: T)

And adding a compiler plugin to your sbt build or command line.

To learn more, read the introduction to miniboxing.