Skip to content

Change membersLeft from a QList to a QSet#956

Merged
KitsuneRal merged 1 commit intodevfrom
work/redstrate/members-left-perf-win
Feb 14, 2026
Merged

Change membersLeft from a QList to a QSet#956
KitsuneRal merged 1 commit intodevfrom
work/redstrate/members-left-perf-win

Conversation

@redstrate
Copy link
Copy Markdown
Collaborator

I noticed in a profiling flamegraph that this was an outsized part during preprocessStateEvent, because we kept calling removeOne which performs an expensive search. In a quick test on my account, the list was in the magnitudes of hundreds of items big. And then there could be multiple rooms like that...

Anyway this is an easy win for QSet, which has a faster lookup compared to QList.

@sonarqubecloud
Copy link
Copy Markdown

@KitsuneRal
Copy link
Copy Markdown
Member

Wow - I did not expect membersLeft to have more than a hundred or two entries.

Comment thread Quotient/room.cpp Outdated
@KitsuneRal KitsuneRal added the performance Things taking too long to get done label Feb 13, 2026
I noticed in a profiling flamegraph that this was an outsized part
during preprocessStateEvent, because we kept calling removeOne which
performs an expensive search. In a quick test on my account, the list
was in the magnitudes of hundreds of items big. And then there could be
multiple rooms like that...

Anyway this is an easy win for QSet, which has a faster lookup compared
to QList.
@redstrate redstrate force-pushed the work/redstrate/members-left-perf-win branch from cbd6d8a to 8c82b79 Compare February 13, 2026 20:30
@redstrate redstrate requested a review from KitsuneRal February 13, 2026 20:31
Copy link
Copy Markdown
Member

@KitsuneRal KitsuneRal left a comment

Choose a reason for hiding this comment

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

Thank you!

@KitsuneRal KitsuneRal merged commit abfdfee into dev Feb 14, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from In work to 0.10 - Done in libQuotient 1 Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Things taking too long to get done

Projects

Status: 0.10 - Done

Development

Successfully merging this pull request may close these issues.

2 participants