matrix-react-sdk
04505b7d - Optimise for 2 person rooms, which should be 99% of cases

Commit
4 years ago
Optimise for 2 person rooms, which should be 99% of cases Performing a virtual user -> native user lookup is rather expensive. It requires making a third-party lookup API call in the background. We would rather not need to do so every time a call comes in. Translating a virtual room to a native room is rather cheap in contrast - the client already knows about it. Thus, we can make an optimisation by checking if the corresponding native room has only two users in it. If so, we can likely assume that whichever user in the native that's not us, is probably the same user that calls us via the virtual room. Thus in that case, we just return that user's profile information.
Author
Committer
Parents
Loading