Spotless: Gradle configuration time taking too long in windows

Created on 28 Sep 2018  路  5Comments  路  Source: diffplug/spotless

summary of problem

There is a huge gap in configuration time when spotless plugin is applied in a multi-project build between windows and linux.
I've created a multiproject build with 150 projects to test this out:

Configuration time with spotless plugin

  • 5 seconds in linux
  • between 1m 30s and 2m in windows.

Configuration time without spotless plugin

  • 0.6 seconds in linux
  • 1 seconds in windows.

In windows the difference is overwhelming, slowing down the overall build time.

versions

Java 1.8
Spotless 3.15.0
Gradle 4.10.2
Windows 10

example project: projectA.zip

In projectA.gradle there is a boolean variable to activate spotless plugin called spotless_plugin. You can try to enable and disable it.
you can test this running from within the root projectA:
linux ./gradlew clean build --parallel --scan
windows gradlew.bat clean build --parallel --scan

bug

All 5 comments

Thanks for the interesting case. Until someone finds time to investigate the root cause, #277 should at least alleviate the symptoms of this.

Any news about this?
It's starting to be a pain even in linux.

Thanks

PR #277 would help your case. Its author has run out of time, but it is done except for tests. Anyone is welcome to finish off the PR :)

Looking at your file, you have a very broad target:

target fileTree(dir: project.rootDir, includes: [
  "**/*.md",
  "**/.gitignore",
  "**/Jenkinsfile*"
], excludes: [
  "**/build/**",
  "**/bin/**",
  "**/gen/**"
])

Your performance would improve greatly if you made those ** more specific. Having ** in the root project is especially troublesome, because it is searching in all of the child projects too, causing double-work.

PR #277 would help your case. Its author has run out of time, but it is done except for tests. Anyone is welcome to finish off the PR :)

Indeed! As the author of said PR, I wanted to apologise for my lack of activity or even acknowledgement that I'd run out of time (and energy) to continue working on it. I intend to say this on the PR within the next few days and to provide a pointer or two on how it could be finished.

I have done a really big mistake here!

target fileTree(dir: project.rootDir, includes: [

project.rootDir must be project.projectDir

DAMN!
sorry, my fault...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Puneetha17 picture Puneetha17  路  6Comments

I-Vargas picture I-Vargas  路  3Comments

scphantm picture scphantm  路  7Comments

PoonamGargAgarwal picture PoonamGargAgarwal  路  3Comments

fabriziocucci picture fabriziocucci  路  5Comments