-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Viewing room list in a Space / Searching for rooms in a Space is very slow #11694
Comments
Searching is done client side, so your client is paginating through the entire space finding all results. I Don't know if they're shown as they get matched or at the end though. See #10523 also for performance with this API. |
This seems to be exacerbated by a few things:
We also could be a bit more aggressive about caching results over federation, right now they're only cached for a few minutes. |
Note that #12073 should help with the first part (as there's no longer a I think the clokep/hierarchy-404s branch might help a bit with the 404s issue, but not sure if that's the problem. |
@clokep kindly slipped me a sneaky branch to try (the one above) and empirically seems to have brought down most request times from |
I noticed when looking at the code that if we're in a space/room, we use our local copy and recurse into children. If we're not in a space/room, we request that room from a remote homeserver which includes all its subtree of spaces. A knock-on effect is that joining a space or subspace makes the hierarchy slower because we send one HTTP request per child, rather than just requesting the parent and having the children included in the response. The code seems like it has already been well-written and set up to cache remote results, so perhaps a simple(-seeming) way to make things faster would be to request the root space (or any parent space where we need to look up ≥2 or 3 of its children on a remote) from a remote homeserver. In the happy case, this will pre-cache the children and prevent us from sending one request per child. If the remote doesn't answer properly, then it's only a cache and we can fall back to making individual requests as before. |
I would just like to add that all things being equal, we should prefer exploring solutions which don't rely on server-side search, so that we don't dig ourselves into a hole which prevents us from encrypting room state in the future. |
Still need to find out what's going on here or even what the related requests are, but can't see an issue about it and this is surely something we ought to resolve if we want people to enjoy using spaces.
Description
The 'Explore Space' screen in Element is very slow, even if typing in a search term.
Steps to reproduce
I would expect searching to be much faster than that; let's say 10 seconds or less to be generous given that I suppose I can understand that it may be making a few round trips to remote homeservers.
Version information
The text was updated successfully, but these errors were encountered: