Skip to content

Cleanup with performance gain - #40

Merged
jordikroon merged 1 commit into
php:mainfrom
NickSdot:stack-09-performance
Jul 25, 2026
Merged

Cleanup with performance gain#40
jordikroon merged 1 commit into
php:mainfrom
NickSdot:stack-09-performance

Conversation

@NickSdot

@NickSdotNickSdot 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)

VersioncommandFilesViolationsRuntime
main.11,527115,1134.19s
stack-08-cleanup.11,52745,1714.15s
stack-09-performance.11,52745,1713.67s
stack-09-performance. --wide11,52745,1713.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
NickSdotforce-pushed the stack-09-performance branch 2 times, most recently from bcd595a to 20ffd41CompareJuly 22, 2026 07:39
@NickSdot
NickSdotforce-pushed the stack-09-performance branch 4 times, most recently from 7e9f32c to 51f6d1fCompareJuly 25, 2026 09:32
@NickSdotNickSdot mentioned this pull request Jul 25, 2026
@NickSdot
NickSdotforce-pushed the stack-09-performance branch 4 times, most recently from d077884 to cae2f8cCompareJuly 25, 2026 17:29
@NickSdot
NickSdotforce-pushed the stack-09-performance branch from cae2f8c to ff2f58dCompareJuly 25, 2026 17:38
@jordikroon
jordikroon marked this pull request as ready for review July 25, 2026 17:45
@jordikroon
jordikroon merged commit d5f6922 into php:mainJul 25, 2026
3 checks passed
Sign up for freeto 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.

2 participants

@NickSdot@jordikroon