Skip to content

Eliminate O(n^2) status removal in DashboardTreeTableModel - #316

Merged
tonygermano merged 1 commit into
OpenIntegrationEngine:mainfrom
NicoPiel:fix/dashboard-status-removal
Oct 29, 2026
Merged

tonygermano merged 1 commit into
OpenIntegrationEngine:mainfrom
NicoPiel:fix/dashboard-status-removal

Conversation

@NicoPiel

Copy link
Copy Markdown
Contributor

updateChannelNodes called statuses.remove(status) inside a loop over
child nodes. With an ArrayList, each remove is O(n), making the update
O(channels × statuses). Collected matched statuses in a HashSet and
called removeAll once after the loop, reducing to O(n + m).

@github-actions

github-actions Bot commented May 27, 2026 •

Copy link
Copy Markdown

Test Results

130 files  ±0  130 suites  ±0   4m 10s ⏱️ + 1m 8s
789 tests ±0  789 ✅ ±0  0 💤 ±0  0 ❌ ±0 
915 runs  ±0  909 ✅ ±0  6 💤 ±0  0 ❌ ±0 

Results for commit 4589238. ± Comparison against base commit a403039.

♻️ This comment has been updated with latest results.

@NicoPiel NicoPiel self-assigned this May 27, 2026
@NicoPiel
NicoPiel requested review from a team, gibson9583, jonbartels, kayyagari, mgaffigan, pacmano1, ssrowe and tonygermano and removed request for a team May 27, 2026 21:03
@jonbartels

Copy link
Copy Markdown
Contributor

Is there an existing unit test that covers this method?

If no, can you create one?

mgaffigan
mgaffigan previously approved these changes May 27, 2026

@mgaffigan mgaffigan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks fine, but was this showing up on a profiler? There's going to be a lot of changes if you are not chasing based on actual performance issues.

@jonbartels jonbartels added this to the Next Release milestone May 27, 2026
kpalang
kpalang previously approved these changes Jun 17, 2026

@kryskool kryskool left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch, works for me

@tonygermano tonygermano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Similar to Mitch's comment, is there a measurable improvement from this change? The old code wasn't wrong. I don't want to turn down improvements, but I also don't want to encourage optimizations with no measurable impact, as they take up PR review bandwidth that could be used elsewhere.

@NicoPiel

NicoPiel commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

I haven't measured anything; probably only measurable with a huge dashboard. I was looking for potential optimisations to the dashboard and stumbled upon this.

@tonygermano tonygermano removed this from the Next Release milestone Oct 9, 2026
tonygermano
tonygermano previously approved these changes Oct 28, 2026
updateChannelNodes called statuses.remove(status) inside a loop over
child nodes. With an ArrayList, each remove is O(n), making the update
O(channels × statuses). Collected matched statuses in a HashSet and
called removeAll once after the loop, reducing to O(n + m).

Signed-off-by: Nico Piel <nico.piel@hotmail.de>
@tonygermano
tonygermano dismissed stale reviews from kpalang, mgaffigan, and themself via 4589238 October 28, 2026 21:59
@tonygermano
tonygermano force-pushed the fix/dashboard-status-removal branch from c22b8ba to 4589238 Compare October 28, 2026 21:59
@tonygermano
tonygermano requested a review from a team as a code owner October 28, 2026 21:59

@tonygermano tonygermano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

reviews dismissed during rebase because this PR was created before the Gradle directory moves.

@tonygermano
tonygermano merged commit 4589238 into OpenIntegrationEngine:main Oct 29, 2026
20 checks passed
@tonygermano tonygermano added this to the Next Release milestone Oct 29, 2026
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.

6 participants