Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Speed up state res v2 across large state differences. (#7725)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston authored Jun 19, 2020
1 parent 1b1489f commit 91e886d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/7725.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Speed up state res v2 across large state differences.
3 changes: 2 additions & 1 deletion synapse/state/v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ def resolve_events_with_store(
# OK, so we've now resolved the power events. Now sort the remaining
# events using the mainline of the resolved power level.

set_power_events = set(sorted_power_events)
leftover_events = [
ev_id for ev_id in full_conflicted_set if ev_id not in sorted_power_events
ev_id for ev_id in full_conflicted_set if ev_id not in set_power_events
]

logger.debug("sorting %d remaining events", len(leftover_events))
Expand Down

0 comments on commit 91e886d

Please sign in to comment.