Let miniboxing tell you when your code could be improved: -P:minibox:warn


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 ScalaDays talk on miniboxing:


Please keep in mind that the miniboxing plugin is a beta release, and not a feature-complete, perfect drop-in for your project.

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!