matrix-org / matrix-org/matrix-rust-sdk
Slow call to `olmMachine.getRoomSettings()`
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 500
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 106
Description
A bit of context first: we are migrating from the legacy crypto stack to rust crypto stack. In EW, we need to know if the room is encrypted to display it. This assertion is a part of the critical path of EW.
To know if the room is encrypted, we look at the room settings thanks to [`olmMachine.getRoomSettings()`](https://github.com/matrix-org/matrix-js-sdk/blob/develop/src/rust-crypto/rust-crypto.ts#L387).
We have spot a performance issue when trying to get this value from less than 1sec to multiple secs to respond.
Contributor guide
Research direction
Start with the referenced olmMachine.getRoomSettings() entry point in src/rust-crypto/rust-crypto.ts and profile the call when checking whether a room is encrypted. Trace the slow path into the Rust crypto implementation, then verify that the lookup consistently avoids multi-second responses in the critical path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100