mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-09 00:15:23 -04:00
When all room members are loaded, we do not need an incremental member update. We know that parsing the /members response will only lead to more ambiguous names, not less. And because /members returns the complete list, we can directly use that list as the disambiguation map. This improves the performance in my emulator from 56s to 9s and on a less performant device from 11mins to 11s (Tested experimentally on Matrix HQ using log statements in element android. If I have time, I will write a proper benchmark tomorrow. See also https://github.com/matrix-org/matrix-rust-sdk/pull/3184#issuecomment-1986170631 for a more detailed benchmark run. --- * members: Simplify disambiguation logic * members: Prevent api misuse for receive_members * members: Benchmark receive_all_members performance * sdk: remove unused import * sdk-base: rename `ApiMisuse` error to `InvalidReceiveMembersParameters` * benchmarks: extract the member loading benchmark to `room_bench.rs` * benchmarks: remove wiremock * sdk-base: fix format * sdk-base: try fixing tests * benchmark: Provide some data to the store so the search and disambiguation happen * benchmark: fix clippy * benchmark: use a constant for `MEMBERS_IN_ROOM` * sdk(style): reduce indent in `receive_all_members` --------- Co-authored-by: Jorge Martín <jorgem@element.io> Co-authored-by: Benjamin Bouvier <public@benj.me>
This crate implements the base to build a Matrix client library.
Crate Feature Flags
The following crate feature flags are available:
encryption: Enables end-to-end encryption support in the library.qrcode: Enables QRcode generation and reading code.testing: Provides facilities and functions for tests, in particular for integration testing store implementations. ATTENTION: do not ever use outside of tests, we do not provide any stability warantees on these, these are merely helpers. If you find you need any function provided here outside of tests, please open a Github Issue and inform us about your use case for us to consider.