Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow call to olmMachine.getRoomSettings() #4337

Open
florianduros opened this issue Nov 27, 2024 · 1 comment
Open

Slow call to olmMachine.getRoomSettings() #4337

florianduros opened this issue Nov 27, 2024 · 1 comment

Comments

@florianduros
Copy link
Contributor

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().

We have spot a performance issue when trying to get this value from less than 1sec to multiple secs to respond.

@poljar
Copy link
Contributor

poljar commented Nov 27, 2024

The relevant method for EW should live in the indexedDB crate:

async fn get_room_settings(&self, room_id: &RoomId) -> Result<Option<RoomSettings>> {
let key = self.serializer.encode_key(keys::ROOM_SETTINGS, room_id);
self
.inner
.transaction_on_one_with_mode(keys::ROOM_SETTINGS, IdbTransactionMode::Readonly)?
.object_store(keys::ROOM_SETTINGS)?
.get(&key)?
.await?
.map(|v| self.serializer.deserialize_value(v))
.transpose()
}

Nothing really jumps out, looks like a simple key/value get operation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants