Observed behaviour:
mvn spotless:check -Dspotless.ratchetFrom=origin/develop
takes several seconds on a large java repository (20+ maven modules, 10k java files) even when the number of "dirty files" is quite small (~20). This is on a fairly modern laptop with extremely fast SSD (macbook pro m5).
Basic profiling shows that most of the time is spent inside GitRatchetMaven recomputing the list of dirty files for the repository over and over again (looks like it is getting triggered once for each maven module and formatter combination).