Introducing up-to 16 Times Faster Easy Coding Standard

Do you use Easy Coding Standard? Do you find extremely useful and easy to use, but a little slow on a huge code base?

If you follow me carefully on Twitter, you already know that the ECS got a new parallel run feature. I wanted to test it in a circle of early adopters first, so we make the run as smooth as possible for you.

Today, we're sharing the ECS Parallel run with the public, so you can cut down ECS run times from minutes to seconds.


Bottle Neck?

Coding Standard tools are very fast in processing single file. They parse PHP code to tokens, analyze tokens in a foreach loop, and report found issues. The performance hit is in the number of processed files. If we have 10 files, the 1st file is processed. The 2nd file cannot start until the 1st file is finished.

Fortunately, this architecture has huge potential in performance improvement once we add a parallel run. That's what I've been working for July and August this summer. Huge thanks to Ondrej Mirtes for inspiration in PHPStan parallel run.

ECS is now X-times Faster!

...where X = number of your CPU threads. What does it mean?


You might think: "such CPUs must be expensive and available only for high-end laptops". You'll be surprised.

Don't Take My Word for It

We've got few reports from our early adopters. How does ECS handle their projects?

Enjoy Parallel ECS in Your Project Today

How to add this feature to your project?

Be sure to use at least ECS 9.4.70:

composer require symplify/easy-coding-standard:^9.4.70

And enable a new parameter in your ecs.php config file:

 use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
 use Symplify\EasyCodingStandard\ValueObject\Option;

 return function (ContainerConfigurator $containerConfigurator): void {
     $parameters = $containerConfigurator->parameters();
+    $parameters->set(Option::PARALLEL, true);
 };

That's it!


The parallel run might become enabled by default in ECS 10. We have enough time to test it on real projects and make it reliable till then. So far, it has been tested on Linux and Windows. If you're lucky enough to find the edge case, please let us know in issues, so we can cover it.


Happy coding!




Do you learn from my contents or use open-souce packages like Rector every day?
Consider supporting it on GitHub Sponsors. I'd really appreciate it!