4

We are using maker to build a very large scala project. It takes about 3 minutes to compile an 18 layer project (about 30 - 40 modules).

I was interested in comparing the performance with a more recent SBT and I created a quick and dirty build file for sbt 0.12.4. Despite SBT using parallel compilation, it took 10 minutes to compile the same project from clean (not counting ivy download time).

The console output seemed to be preoccupied with resolving the dependencies, which were all in my ivy cache. I stumbled upon Why sbt runs dependency resolution every time after clean? and it provides a hack that at least speeds up the second build to 3.5 minutes. However, this hack does not work on 0.13.x.

  1. What is the equivalent hack in 0.13?
  2. Is there anything else can be done to speed up an sbt compile?

Although this is not the project, assume for all intents and purposes that my build script looks something like build.scala (this file was the template that I used and added the hack around line 54).

Community
  • 1
  • 1
fommil
  • 5,757
  • 8
  • 41
  • 81

1 Answers1

2

Here you go, add this. Works for me on 0.13.1.

cleanKeepFiles ++= Seq("resolution-cache", "streams").map(target.value / _)
Golly
  • 1,319
  • 8
  • 18