Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up CS run by factor 4 #241

Merged
merged 1 commit into from
Feb 22, 2019
Merged

Speed up CS run by factor 4 #241

merged 1 commit into from
Feb 22, 2019

Conversation

dereuromark
Copy link
Member

@dereuromark dereuromark commented Feb 22, 2019

We had some performance improvements done recently in Spryker
Our findings I also want to share with u.

Apparently, cs sniffer is > 4x faster without xdebug on.

23s => 10s for master branch since we dont have too many tests yet.

In larger code bases with even more sniffs this is quite noticeable:

  • huge repo: 1470s => now only 319s (24 => 5 min!)
  • medium repo: 118s => now only 26s (2 => 0.5min)

@dakota
Copy link
Member

dakota commented Feb 22, 2019

What also makes a huge difference is running it parallely (The --parallel option). We found a value of around 75 works really well (squizlabs/PHP_CodeSniffer#1732 for some more info)

@ADmad
Copy link
Member

ADmad commented Feb 22, 2019

I guess the --parallel switch should be added in command used for core's travis job.

@ADmad ADmad merged commit 5aefaeb into master Feb 22, 2019
@ADmad ADmad deleted the speedup branch February 22, 2019 13:06
@swiffer
Copy link
Contributor

swiffer commented Mar 2, 2020

@ADmad / @dereuromark - it's possible to define a cache file for PHP_CodeSniffer. This dramatically reduces runtime (48s -> 500ms)!

e.g. phpcs --cache=.cache/phpcs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants