This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Increase DB/CPU perf of _is_server_still_joined
check.
#6936
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For rooms with large amount of state a single user leaving could cause us to go and load a lot of membership events and then pull out membership state in a large number of batches.
erikjohnston
force-pushed
the
erikj/speed_up_is_server_still_joined
branch
from
February 18, 2020 11:50
b2f8ec7
to
d7beb16
Compare
richvdh
suggested changes
Feb 18, 2020
Co-Authored-By: Richard van der Hoff <[email protected]>
richvdh
approved these changes
Feb 19, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm otherwise
synapse/storage/persist_events.py
Outdated
@@ -736,8 +736,10 @@ def _maybe_start_persisting(self, room_id: str): | |||
if event_id == event.event_id: | |||
if event.membership == Membership.JOIN: | |||
return True | |||
else: | |||
events_to_check.append(event_id) | |||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the obscure else:
here is redundant.
synapse/storage/persist_events.py
Outdated
Comment on lines
751
to
752
# None of the changes to state are joins, so we fall back to checking | ||
# the current state of the room to see if any of our users are joined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to die
babolivier
pushed a commit
that referenced
this pull request
Sep 1, 2021
* commit '0d0bc3579': Increase DB/CPU perf of `_is_server_still_joined` check. (#6936)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For rooms with large amount of state a single user leaving could cause us to go and load a lot of membership events and then pull out membership state in a large number of batches.