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

Element-R: takes **ages** to load #26352

Closed
richvdh opened this issue Oct 10, 2023 · 3 comments
Closed

Element-R: takes **ages** to load #26352

richvdh opened this issue Oct 10, 2023 · 3 comments
Assignees
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Z-Labs

Comments

@richvdh
Copy link
Member

richvdh commented Oct 10, 2023

If I ctrl-R in an EWR tab for my main account, it takes over 60 seconds for the spinner to go away.

@richvdh richvdh added T-Defect A-Element-R Issues affecting the port of Element's crypto layer to Rust labels Oct 10, 2023
@weeman1337 weeman1337 added S-Major Severely degrades major functionality or product features, with no satisfactory workaround O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience Z-Labs labels Oct 11, 2023
@poljar
Copy link
Contributor

poljar commented Oct 15, 2023

One source for the slowness might be the usage of a passphrase when opening the store:

https://github.com/matrix-org/matrix-rust-sdk/blob/a433d51efc44fbab6515a35b2589dcf08920f087/crates/matrix-sdk-indexeddb/src/crypto_store.rs#L320

This step will use PBKDF2 to expand the passphrase into a 32 byte key.

The StoreCipher can be initialized with a random key, this skips the PBKDF2 step:

https://github.com/matrix-org/matrix-rust-sdk/blob/a433d51efc44fbab6515a35b2589dcf08920f087/crates/matrix-sdk-store-encryption/src/lib.rs#L317

The above method needs to be exposed in the IndexedDB cryptostore implementation.

@richvdh
Copy link
Member Author

richvdh commented Oct 16, 2023

There's a lot of logging going on while the spinner is up. I don't think it's anything as simple as waiting for a PBKDF.

@BillCarsonFr
Copy link
Member

I did some tests and here are the results. Ran 10 refreshs with a legacy and a rust stack with my real account:

image

There was a long run for rust (first one) other than that it looks similar?
It's not taking 60s anymore

@BillCarsonFr BillCarsonFr closed this as not planned Won't fix, can't repro, duplicate, stale Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Z-Labs
Projects
None yet
Development

No branches or pull requests

4 participants