checkstyle / contribution

some useful sources that should not stay in main repo but it is good to host them

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

diff.groovy: add multi thread support

rnveach opened this issue · comments

We need to add multi-threading support to diff.groovy for regression runs.

Right now, running a big config on 48 projects takes me about 150 minutes total. Regression only runs on a single thread currently, so most CPUs time is spent waiting as most computers have multiple cores these days.

This is blocked by checkstyle/checkstyle#4409 .

I have started a test area for my multi-threading implementation and currently 2 additional threads reduces my run times almost in half (80 minutes) with regression showing no differences.

Checkstyle MT Test Branch: checkstyle/checkstyle@master...rnveach:checkstyle:issue_138_rebase_slim
Config's Root Module: MultiThreadedChecker
Config's Thread Property: <property name="numberOfThreads" value="3"/>
Launch Diff Test Branch: https://github.com/rnveach/contribution/commits/rvmaster

Command to run on Linux with custom JAR:
java -classpath multithreading.jar:checkstyle-10.7.0-SNAPSHOT-all.jar com.puppycrawl.tools.checkstyle.Main -c ...
Windows users probably have to swap : with ; in the classpath.

Current Regression Results:
http://rveach.no-ip.org/checkstyle/regression/334/
http://rveach.no-ip.org/checkstyle/regression/333/

Let's not go to MT mode of checkstyle itself.

Let's do it easier by execution of checkstyle in single thread and process, but have multiple threads of groovy to run each project in separate thread/process. MT in groovy.