I have a laptop with dual boot on which I noticed significant performance difference on my Android work project between Windows 10 and Linux Ubuntu 14. I isolated the main difference to the java compile time phase, I therefore did a controlled experiment where I generated a pure java project with 500+ files of which I timed the compile times. The results are illustrated in this image:
“javac” is where I did a pure command-line compile with the java compiler outside of gradle, while “gradle” is running “./gradlew assemble --rerun-tasks”. All tests are are done 4 times where I took the average of the last 3, discarding the first.
The repo with the test code is here.
In short it looks like the NTFS file system makes gradle slow. The difference are much bigger when using gradle then when using pure javac (141% gain to 21%). Therefore I dare say gradle has a part to play in the slow-down on Windows/Ubuntu+NTFS here - or rather lack of performance gain.
The 141% compile time penalty is not one I’m prepared to take in my daily work.
In both experiments I had the laptop plugged in to power, I was using java 64 bit v1.8.0_73 and I had parallelization enabled with gradle by using identical gradle.settings like this:
Anyone have any theory of why gradle java compilation is so much slower on NTFS? Is there any configuration I can do to improve it? Is there something intrinsic in the Gradle code that needs to be improved?