You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Improve performance of /sync when the filter specifies no room IDs #14784
It would be nice It is critical for Sliding Sync if Synapse checked if the filter JSON was specifying a set of room IDs, and if so just apply /sync to those rooms, which should be significantly faster than a general /sync.
Context: Sliding Sync hits /sync on behalf of users. The first sync is always slow because it needs the data from /sync. However, the first /sync on a 2nd+ device for the same user can be very fast, because the proxy does not wait for the /sync response, it can just serve up the room data fetched from the 1st device. However, to-device messages are per-device and only arrive with the /sync response: I can't do the same trick. In an effort to reduce the /sync time, I specify a filter with room.rooms=[] which means "no room IDs". This correctly returns no rooms, but it still takes just as long to process.
The end-user impact here is that, whilst Matthew can login to sliding-sync enabled Elements within seconds, it takes 15+ minutes before he can read E2EE messages because to-device messages are delayed.
Steps to reproduce
Matthew hits /sync with a filter of { room: { rooms: [] } }
@kegsay I don't think filtering with an empty array does anything, see matrix-org/matrix-spec#1312. You could try a filter of { room: { not_rooms: ["*"] } } which I think will be slightly better, but will still do some processing over rooms.
changed the title [-]Improve performance of /sync when the filter specifies room IDs[/-][+]Improve performance of /sync when the filter specifies no room IDs[/+]on Jan 6, 2023
Activity
clokep commentedon Jan 6, 2023
@kegsay I don't think filtering with an empty array does anything, see matrix-org/matrix-spec#1312. You could try a filter of
{ room: { not_rooms: ["*"] } }which I think will be slightly better, but will still do some processing over rooms.[-]Improve performance of /sync when the filter specifies room IDs[/-][+]Improve performance of /sync when the filter specifies no room IDs[/+]clokep commentedon Jan 10, 2023
#14786 did help here, but...skipped properly calculating changed devices. I'm going to re-open this and back-out the broken bits (#14810).