Scala compilation performance decrease in Gradle 2.12+

After upgrading from Gradle 2.11 to 2.12 (and later) we have seen a significant performance decrease in scala compilation.

I have created a sample with 50 subprojects each one having a single scala source file. I have done some measurements comparing Gradle 2.11 to Gradle 3.0. Here are my results:

gradlew.bat --daemon --parallel clean build

2.11: 12s

3.0: 26s

gradlew.bat --daemon clean build

2.11: 16s

3.0: 18s

gradlew.bat --daemon --parallel --max-workers=4 clean build

3.0: 18s

gradlew.bat --daemon --parallel --max-workers=6 clean build

3.0: 22s

As you can see, --parallel really hurts performance. Removing the --parallel options helps but I cannot get 2.11 performance and I really do not like to sacrifice --parallel.

My OS is Windows 8.1 and Java is 1.8.0_60.

Is this a known performance issue with Gradle 2.12+?

SlowScala.zip (31.4 KB)

As mentioned in the linked thread, the issue performance doesn’t seem to drop when switching from Zinc back to the ant-based compiler.

If there is no possible tuning to achieve the same performance on a clean build, it would be pretty nice to bring back the option of using the ant-compiler.

Cheers,
Daniel