Test::Perl::Critic Is Now Wicked Fast
Test::Perl::Critic-1.02_002 has just hit CPAN. The new release uses MCE to run tests in parallel across multiple cores. So if you have an 8 core machine, you could see an 8x performance boost! If you are using the recommended all_critic_ok()
function then no code changes are required -- just upgrade and fire away.
For the moment, this is just a developer release so you'll have to fetch it explicitly (using cpanm) as THALJEF/Test-Perl-Critic-1.02_002.tar.gz
. MCE is very robust and it should behave well on all sorts of platforms and hardware. But I'd really appreciate if you give it a try and report any problems on GitHub.
Update: That should be version 1.02_002
, not 1.02_001
as originally written.
Thanks. Enjoy!
Does this run tests in parallel even if you're only testing a single file? Or are files run in parallel?
I've never heard of MCE, thanks for the mention!
Great news! Could Perl Critic itself be made to run in parallel?
Test::Perl::Critic sees each file as a single test. So testing a single file won't get any speed boost from MCE.
I am working on adding MCE directly to the Perl::Critic API, so that all clients can reap the benefits.
Each Policy could also be run in parallel, but I doubt it would help. Most of the overhead is parsing the file.