mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-18 13:40:55 -04:00
This patch improves throughput by +710% in `room_list_service` sorters and filters. It introduces a new `room_list_service::Room` type that derefs to `matrix_sdk::Room`. However, it **caches** some data from `matrix_sdk::Room`. Why doing so? Because filters, but more specifically sorters!, are calling methods on `matrix_sdk::Room`, so likely on `matrix_sdk::RoomInfo`, quite intensively. `RoomInfo` is behind a `SharedObservable`, which means it's behind a lock. Each time a sorter sorts 2 rooms, the lock on `RoomInfo` can be called twice or more. By caching the data, `RoomInfo` is reached once per refresh data, but not during the filtering nor the sorting. It greatly reduces contention on the `RoomInfo` lock, which improves the throughput by +710%, and the time by -87%. The cached data are refreshed in `merge_stream_and_receiver` when (i) the stream of `Room` is updated, or when (ii) the stream of `RoomInfoNotableUpdate` is updated. It's a central place it happens, which isolates the behaviour.
Matrix Rust SDK bindings
In this directory, one can find bindings to the Rust SDK that are maintained by the owners of the Matrix Rust SDK project.
appleormatrix-rust-components-swift, Swift bindings of thematrix-sdkcrate viamatrix-sdk-ffi,matrix-sdk-crypto-ffi, UniFFI (Kotlin, Swift, Python, Ruby) bindings of thematrix-sdk-cryptocrate,matrix-sdk-ffi, UniFFI bindings of thematrix-sdkcrate.
There are also external bindings in other repositories:
matrix-sdk-crypto-wasm, JavaScript / WebAssembly bindings of thematrix-sdk-cryptocrate,matrix-sdk-crypto-nodejs, Node.js bindings of thematrix-sdk-cryptocrate
Contributing
To contribute read this guide.