Skip to content

perf: avoid O(n²) array copies when merging worker TestResults#1106

Closed
jorgsowa wants to merge 1 commit into
paratestphp:7.xfrom
jorgsowa:perf/reduce-array-merge-in-complete
Closed

perf: avoid O(n²) array copies when merging worker TestResults#1106
jorgsowa wants to merge 1 commit into
paratestphp:7.xfrom
jorgsowa:perf/reduce-array-merge-in-complete

Conversation

@jorgsowa

Copy link
Copy Markdown

Replace 21 array_merge_recursive calls per result file with mutable accumulators and array_push, then construct TestResult once after the loop. Reduces complexity from O(N²×M) to O(N×M).

Doesn't look pretty, though. Maybe a later helper can be created to improve readability.

Replace 21 array_merge_recursive calls per result file with mutable
accumulators and array_push, then construct TestResult once after the
loop. Reduces complexity from O(N²×M) to O(N×M).
@jorgsowa jorgsowa marked this pull request as draft May 13, 2026 09:21
@jorgsowa jorgsowa marked this pull request as draft May 13, 2026 09:21
@jorgsowa jorgsowa force-pushed the perf/reduce-array-merge-in-complete branch from 66a5a5c to 48fd7ba Compare May 13, 2026 09:22
@Slamdunk

Copy link
Copy Markdown
Member

Please ensure the build pass on your local machine using make before publishing the changes.

@jorgsowa jorgsowa closed this May 13, 2026
@jorgsowa

Copy link
Copy Markdown
Author

Yes, sorry. That's why I marked PR as a draft.

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