Repository navigation
Sorting tests by duration recomputes the duration of a test suite for every comparison - #7035
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 13.4 #7035 +/- ##
============================================
- Coverage 99.57% 99.57% -0.01%
- Complexity 9907 9908 +1
============================================
Files 964 964
Lines 30083 30081 -2
============================================
- Hits 29956 29954 -2
Misses 127 127 ☔ View full report in Codecov by Harness. |
|
Thank you for this. Since PHPUnit 13.2.5, the weight of a test suite is the sum of the durations of the tests it contains. I consider this a fix for a performance regression and would like to ship it in PHPUnit 13.4.2. Can you please rebase your branch onto |
20b4314 to
b23197e
Compare
Sorting shouldn't fetch the weights at each comparison. It's better to sort the precomputed weights and then map them to the Test objects array. The new approach should theoretically be ~.5% faster, but it should also prevent accidental bugs if, at any point in time,
weightis no longer a pure method. And ifweightbecomes more computationally expensive, the performance won't drop exponentially.