Symplify: [ECS] speed up sniff,fixer processing

Created on 25 Feb 2019  路  3Comments  路  Source: symplify/symplify

What is happening

seem like ecs are too slow for me, for instance i tested it on shopsys/shopsys

./vendor/bin/ecs check --clear-cache ./packages/*/src ./packages/*/tests ./packages/*/*.md ./*.md ./docs

it lasted for 1 minute, and the process seemed to me too slow so i tried to speed it it by pcntl_fork so it lasted just 20 seconds but i wasn't able to get the correct output from forked processes.

What should be the result

maybe some docs how to speed up some configuration of sniffs, fixers or some speed improvement.
THX.....

All 3 comments

That's expected time in big projects like Shopsys.

Also it might be caused by using big amount of rules.

  • If there is some stuck fixer/sniff, try running it with --debug.
  • What is the time for code sniffer or PHP CS Fixer with same setup?
  • How many rules do you have? vendor/bin/ecs show

It takes 25-30 seconds to process Symplify monorepo with 350 files and with 174 rules ecs.yml, just to give you an idea.

Also, in practice you should always use cached result, unless you debug sniff/fixer.

This is too vague kind of issue to do anything meaningful. Concrete ideas for improvements are much better. This one seems like support post.

As an example, I was thinking to contribute some async stuff to ECS since I have some experience with it. So in that case issue for integrating amphp might be on point. That's example concrete idea for performance improvement.

@ostrolucky I have the same feeling.

Performance ideas are nice, but the implementation is often problematic. It requires Blackfire research with specific place before/after change to proove the change has effect - @boris-brtan take it as recipe for next performance issues.

I tried async runs before - it required dozens of extra files making code very confusing. In the end cache that skips unchanged files solves it much better way with minimal added complexity.


Closing as too vague.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marcospassos picture marcospassos  路  4Comments

tarlepp picture tarlepp  路  7Comments

crazko picture crazko  路  9Comments

TomasVotruba picture TomasVotruba  路  7Comments

TomasVotruba picture TomasVotruba  路  3Comments