Skip to content

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Aug 28, 2025

at this point its mostly guess work.

having loops after each other should be faster then nested loops though - O(3n) vs. O(n^2).

$classes[$parentClass->namespacedName()],
);

foreach ($merged as $mergedFile => $lines) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this loop moved after the outer loop


foreach ($merged as $mergedFile => $lines) {
$merged[$mergedFile] = array_unique($lines);
if (!isset($classesThatExtendClass[$parentClass->namespacedName()])) {
Copy link
Contributor Author

@staabm staabm Aug 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved this if-condition, so we reflect the same structure as the foreach-loop above (just readability)

@staabm staabm marked this pull request as draft August 29, 2025 06:31
@staabm
Copy link
Contributor Author

staabm commented Aug 29, 2025

we need to be more incremental as our problem is memory, not cpu: #1089

@staabm staabm closed this Aug 29, 2025
@staabm staabm deleted the less-nesting branch August 29, 2025 06:58
Sign up for free to 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.

1 participant