Use array_pop() instead of array_shift() for processing Test objects in TestSuite::run() and optimize TestSuite::isEmpty()#5877
Merged
sebastianbergmann merged 2 commits intosebastianbergmann:10.5from Jun 20, 2024
Conversation
0d34397 to
1267e41
Compare
1267e41 to
47449ae
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 10.5 #5877 +/- ##
=========================================
Coverage 92.15% 92.16%
- Complexity 6358 6360 +2
=========================================
Files 677 677
Lines 19270 19274 +4
=========================================
+ Hits 17759 17763 +4
Misses 1511 1511 ☔ View full report in Codecov by Sentry. |
Owner
Can you share a benchmark? Thanks! |
Contributor
Author
|
https://3v4l.org/4vGK2/rfc#vgit.master_jit - with even more items the performance difference is even much higher - one has O(N) complexity as the array is always reallocated, the other one has O(1) |
array_pop() instead of array_shift() for processing Test objects in TestSuite::run()
array_pop() instead of array_shift() for processing Test objects in TestSuite::run()array_pop() instead of array_shift() for processing Test objects in TestSuite::run() and optimize TestSuite::empty()
array_pop() instead of array_shift() for processing Test objects in TestSuite::run() and optimize TestSuite::empty()array_pop() instead of array_shift() for processing Test objects in TestSuite::run() and optimize TestSuite::isEmpty()
Owner
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
improve #5875 performance,
array_shiftis very slow with large arrays