Skip to content

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