pitest icon indicating copy to clipboard operation
pitest copied to clipboard

maven plugin should honor -T flag for multithreading

Open PokingUrsa opened this issue 3 years ago • 1 comments

Maven has a standard flag for enabling multi-threaded builds: "-T". ("-T 1C" is a common way it is used, creating 1 thread per core.)

It doesn't appear that PIT's maven plugin honors this flag. Instead, it has a separate 'threads' configuration option.

Changing the plugin to honor the standard flag would make PIT run faster automatically for anyone using "-T". This should help PIT performance for many users, especially as core counts increase.

PokingUrsa avatar Jul 23 '20 23:07 PokingUrsa

Hmm, afaik Surefire doesn't honor this flag either. It's documentation does mention it in the context of the forkCount property, but only in the context of parallel Surefire executions, not the count of threads started by a single Surefire invocation.

I suspect there's a good reason for keeping these concepts separate: -T specifies the number of concurrent modules that can be built by a multi-module Maven build, so the resources (cores) available to any one module build (including an invocation of PIT) is roughly C / T, not T.

The Surefire documentation does seem to suggest a alternative that should work well for single-module builds and multi-module builds that use a fixed -T value: configure the number of threads to use in terms of C.

Stephan202 avatar Jul 24 '20 07:07 Stephan202