Skip to content

[perf] Remove unneeded array_values() when already list arrays or too early calls - #8857

Merged
TomasVotruba merged 1 commit into
mainfrom
remove-unused-array-values
Oct 27, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
remove-unused-array-values

Conversation

@samsonasik

@samsonasik samsonasik commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Remove unneeded array_values() when already list arrays or too early calls that unneeded for that purpose, which always reordered later.

Run on rector-src codebase itself and consistency faster:

Before: 5.2 seconds

➜  rector-src git:(main) time bin/rector process --clear-cache
 2459/2459 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
                                                                                                           
 [OK] Rector is done!                                                                                                   

bin/rector process --clear-cache  40.31s user 6.17s system 890% cpu 5.221 total

After: 4.8 seconds

➜  rector-src git:(main) git checkout remove-unused-array-values
Switched to branch 'remove-unused-array-values'
➜  rector-src git:(remove-unused-array-values) time bin/rector process --clear-cache  
 2459/2459 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
                                                                                                           
 [OK] Rector is done!                                                                                                   

bin/rector process --clear-cache  39.43s user 5.77s system 927% cpu 4.875 total

@samsonasik

Copy link
Copy Markdown
Member Author

@TomasVotruba ready 👍

@TomasVotruba
TomasVotruba merged commit 7bb74e3 into main Oct 27, 2026
50 checks passed
@TomasVotruba
TomasVotruba deleted the remove-unused-array-values branch October 27, 2026 08:42
@TomasVotruba

Copy link
Copy Markdown
Member

Nice 👌

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants