You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have 6830 java files in my maven project (found with git ls-files "*.java" | wc -l) spread across 44 modules. When I have no changes (git diff --name-only origin/develop returns nothing) and I scan in ratchet mode, it takes nearly 10 minutes to do a no-op. When I removed ratchet mode because I wanted to see how many files were still misformatted, it took less than 20 seconds, even though it had to process every java file.
I was expecting it to be a lot slower because it had to actually read and format 6830 java files, rather than just look at git and see nothing has changed.
If you are submitting a bug, please include the following:
summary of problem
gradle or maven version
spotless version
operating system and version
copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
copy-paste the full content of any console errors emitted by gradlew spotless[Apply/Check] --stacktrace
If you're just submitting a feature request or question, no need for the above.
On my project on my Intel Macbook Pro, using version 2.17.7 it still takes about 9 minutes, similar to version 2.17.6. With ratchet turned off it takes 20 seconds with either version, so it's not made a noticeable difference.
Bummer :(. I'm surprised by this, but the good news is that 2.18.0 adds an up-to-date cache which should help a lot whether ratchet is on or off. (#935)
Activity
[-]'ratchet' mode is very slow[/-][+]'ratchet' mode is very slow (plugin-maven)[/+]nedtwigg commentedon Dec 8, 2021
That is surprising! Here's the codepath as it exists today, but #935 is gonna change things a bit.
spotless/plugin-maven/src/main/java/com/diffplug/spotless/maven/AbstractSpotlessMojo.java
Lines 189 to 209 in 08bf08c
spotless/plugin-maven/src/main/java/com/diffplug/spotless/maven/AbstractSpotlessMojo.java
Lines 215 to 238 in 08bf08c
spotless/plugin-maven/src/main/java/com/diffplug/spotless/maven/GitRatchetMaven.java
Lines 59 to 72 in 08bf08c
nedtwigg commentedon Dec 17, 2021
I believe this should be improved in
plugin-maven 2.17.7. Can you report back @rjmunro?rjmunro commentedon Dec 24, 2021
On my project on my Intel Macbook Pro, using version 2.17.7 it still takes about 9 minutes, similar to version 2.17.6. With ratchet turned off it takes 20 seconds with either version, so it's not made a noticeable difference.
nedtwigg commentedon Dec 25, 2021
Bummer :(. I'm surprised by this, but the good news is that
2.18.0adds an up-to-date cache which should help a lot whetherratchetis on or off. (#935)rjmunro commentedon Feb 9, 2022
Can this be reopened?
nedtwigg commentedon Jan 14, 2023
This should be much improved in our latest
plugin-gradle 6.13.0andplugin-maven 2.30.0thanks toI'm going to close this again, but please reopen if it is still issue in the latest releases.