mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-08 23:32:21 -04:00
Improve /sync performance of when passing filters with empty arrays. (#14786)
This has two related changes: * It enables fast-path processing for an empty filter (`[]`) which was previously only used for wildcard not-filters (`["*"]`). * It special cases a `/sync` filter with no-rooms to skip all room processing, previously we would partially skip processing, but would generally still calculate intermediate values for each room which were then unused. Future changes might consider further optimizations: * Skip calculating per-room account data when all rooms are filtered (currently this is thrown away). * Make similar improvements to other endpoints which support filters.
This commit is contained in:
parent
5e0888076f
commit
7e582a25f8
4 changed files with 21 additions and 9 deletions
|
@ -275,7 +275,7 @@ class SearchHandler:
|
|||
)
|
||||
room_ids = {r.room_id for r in rooms}
|
||||
|
||||
# If doing a subset of all rooms seearch, check if any of the rooms
|
||||
# If doing a subset of all rooms search, check if any of the rooms
|
||||
# are from an upgraded room, and search their contents as well
|
||||
if search_filter.rooms:
|
||||
historical_room_ids: List[str] = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue