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>
37 lines
968 B
TOML
37 lines
968 B
TOML
[package]
|
|
name = "benchmarks"
|
|
description = "Matrix SDK benchmarks"
|
|
edition = "2021"
|
|
license = "Apache-2.0"
|
|
rust-version = { workspace = true }
|
|
version = "1.0.0"
|
|
publish = false
|
|
|
|
[dependencies]
|
|
criterion = { version = "0.5.1", features = ["async", "async_tokio", "html_reports"] }
|
|
matrix-sdk-base = { workspace = true }
|
|
matrix-sdk-crypto = { workspace = true }
|
|
matrix-sdk-sqlite = { workspace = true, features = ["crypto-store"] }
|
|
matrix-sdk-test = { workspace = true }
|
|
matrix-sdk = { workspace = true }
|
|
ruma = { workspace = true }
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
tempfile = "3.3.0"
|
|
tokio = { version = "1.24.2", default-features = false, features = ["rt-multi-thread"] }
|
|
|
|
[target.'cfg(target_os = "linux")'.dependencies]
|
|
pprof = { version = "0.13.0", features = ["flamegraph", "criterion"] }
|
|
|
|
[[bench]]
|
|
name = "crypto_bench"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "store_bench"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "room_bench"
|
|
harness = false
|