Improving compilation speed by order of magnitude

All of our improvements allowed us to decrease build times of freshly checked out workspace – order of magnitude less.

speedup-min
Industry
FinTech
Technology
Scala
Scope
Optimization, tooling
We improved existing solutions and created a new state-of-the-art build system to provide uniform, distributed and highly optimized builds everywhere we need them.
The client

We are working with one of the biggest and most innovative Tier-1 financial institutions and the project consists of one of the largest Scala codebases in the world.

image for article: Improving compilation speed by order of magnitude

The problem – long compile time

In such a big and complicated project compilation times used to be significantly over one hour. We were working on many fronts to radically bring it down.

image for article: Improving compilation speed by order of magnitude

The solution – Compilation speedup
1.

We changed our build system and IDE to use the same incremental compiler (Zinc). That allowed us to generate compile caches during CI builds, and use them on-demand later. Thanks to it, average build time went down from 1h to 25 min, and to just a few minutes with good cache hits.
That also significantly speeded up setting up new workspaces or catching up with master – no need for expensive recompilation saves us up to 1h every time.

2.

We introduced user-specified, limited working sets that would reduce mental and compile overhead. Developers can now focus only on what is important to them.

3.

We designed and developed several improvements for the Scala compiler. One of the examples could be flat classpath which in our environment decreased memory footprint by order of magnitude. It was contributed back and it’s now part of the mainline scalac.

4.

We helped develop a custom build system that would ensure efficiency consistency between CI and IDE builds. Furthermore it gave us a chance to introduce several performance improvements such as no-op compilation faster by order of magnitude, much more effective cache shared between machines, and significantly quicker compilation.

The final results

All in all, all those improvements allowed us to decrease build times of freshly checked out workspace from over one hour to just a few minutes – order of magnitude less.

That not only hugely increased developers’ productivity but also significantly reduced the costs of running our build farm – we are saving hundreds of hours per day.

image for article: Improving compilation speed by order of magnitude

Improve the productivity of your developers with us!
Drop us a line!

"*" indicates required fields

If you click the “Send” button you agree to the privacy policy. Your personal data given in the contact form above will be processed for purposes of answering your inquiry and for any further correspondence regarding this inquiry. The controller of your personal data is VirtusLab Sp. z o.o. For more information, see our Privacy Policy