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

Universal/DisallowInlineTabs: improve sniff performance #216

Merged
merged 1 commit into from
Mar 25, 2023

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Mar 25, 2023

This seemingly small change makes a huge difference in performance for this sniff.

On a run of 300+ files, the sniff was more than 7x faster with these tweaks in place.

Before:

*** START SNIFF PROCESSING REPORT ***
PHPCSExtra\Universal\Sniffs\WhiteSpace\DisallowInlineTabsSniff: 0.0022 secs
*** END SNIFF PROCESSING REPORT ***

After:

*** START SNIFF PROCESSING REPORT ***
PHPCSExtra\Universal\Sniffs\WhiteSpace\DisallowInlineTabsSniff: 0.0003 secs
*** END SNIFF PROCESSING REPORT ***

This seemingly small change makes a huge difference in performance for this sniff.

On a run of 300+ files, the sniff was more than 7x faster with these tweaks in place.

Before:
```
*** START SNIFF PROCESSING REPORT ***
PHPCSExtra\Universal\Sniffs\WhiteSpace\DisallowInlineTabsSniff: 0.0022 secs
*** END SNIFF PROCESSING REPORT ***
```

After:
```
*** START SNIFF PROCESSING REPORT ***
PHPCSExtra\Universal\Sniffs\WhiteSpace\DisallowInlineTabsSniff: 0.0003 secs
*** END SNIFF PROCESSING REPORT ***
```
@jrfnl jrfnl added this to the 1.x Next milestone Mar 25, 2023
@jrfnl jrfnl enabled auto-merge March 25, 2023 23:48
@jrfnl jrfnl merged commit 5226c51 into develop Mar 25, 2023
@jrfnl jrfnl deleted the universal/disallowinlinetabs-improve-performance branch March 25, 2023 23:50
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.

1 participant