The miniboxing talk at PNWScala is available... with a complete tutorial


Miniboxing is a program transformation that improves the performance of Scala generics when used with primitive types. It can speed up generic collections by factors between 1.5x and 22x, while maintaining bytecode duplication to a minimum.

Using miniboxing is as easy as adding the @miniboxed annotation to your program and the compiler plugin to your sbt build or command line.

For more information, see the introduction to miniboxing and the tutorial.


If you prefer video presentations, you may like the PNWScala talk on miniboxing:

If you want to follow the live demo in the presentation on your own, you can use this tutorial.


Please keep in mind that the miniboxing plugin is a beta release, and you may encounter occasional hickups as we are working towards a feature-complete and super-stable implementation.

We are doing our best to make miniboxing a stable transformation, with nightly builds and hundreds of test cases running every night. Yet, there are bugs we haven't fixed yet, so don't be surprised if the plugin fails on some programs. But please do file bugs for such failures, so we can fix them asap! (on average, we fixed a bug every 3 days for the last two months!)

The miniboxing release currently supports two specific versions of the Scala compiler: paper

  • 2.11.7, the current release in the 2.11 series and
  • 2.10.5, the current release in the 2.10 series

Due to compiler bugs (for the 2.10 series) and binary incompatibility of the compiler API (for the 2.11 series), we do not currently support the other versions. We are planning, however, to fully cross-compile against all 2.10 and 2.11 versions and to provide error messages for the earlier and unsupported versions of the Scala compiler. We're sorry for this, but the engineering effort in supporting even two versions of the compiler is significant!