Skip to content

Cleanup with performance gain#40

Draft
NickSdot wants to merge 15 commits into
php:mainfrom
NickSdot:stack-09-performance
Draft

Cleanup with performance gain#40
NickSdot wants to merge 15 commits into
php:mainfrom
NickSdot:stack-09-performance

Conversation

@NickSdot

@NickSdot NickSdot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Adds AbstractSniff::elementNameRanges() to centralises math and deduplicate. Plus shaves roughly 12% off sniffing and 10% off fixing. Before this, we materialised complete lines and source ranges for every candidate. Now we first only do line numbers; ranges are only created for candidates that will be promoted to actual violations.

Depends on #29, #30, #31, #32, #33, #34, #35, #36, #37, #38 and #39.
This PRs diff will shrink as preceding PRs are merged and this branch is rebased.

Diff against previous branch: NickSdot:stack-08-cleanup...NickSdot:stack-09-performance (different to diff in here only until the previous branch was merged)

Version command Files Violations Runtime
main . 11,527 115,113 4.19s
stack-08-cleanup . 11,527 45,171 4.15s
stack-09-performance . 11,527 45,171 3.67s
stack-09-performance . --wide 11,527 45,171 3.64s

Since this wasn't explained before: the 115,113 vs 45,171 difference comes from entity handling:

  • main reports violations from entity expansion against every referencing file -> duplicates
  • we now exclude copies and report them against their actual source files
  • --wide adds those referenced source files as targets; hwoever it does not report duplicates like main

@NickSdot
NickSdot force-pushed the stack-09-performance branch from 6f758d4 to bcd595a Compare July 22, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant