-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Input new message is sometimes very slow (blocking for some seconds) #21612
Comments
Can also reproduce in firefox, when multiple tabs are open. Can't provide any logs because my firefox crashes when saving them. |
I've flagged this as a good first issue, though adventurers should note that it's more on the challenging side. Visit #element-dev:matrix.org on Matrix for support in working on this issue. |
I believe I've tracked this down to the following lines: My understanding after poking through the code is that this issue should occur only in megolm environments, i.e. encrypted group chats. Is that correct? The profiling above indicates that |
I can confirm. This happens only in rooms which are encrypted, especially rooms with many users. |
Currently, calling `Client#prepareToEncrypt` in a megolm room has the potential to block for multiple seconds while it crunches numbers. Sleeping for 0 seconds (approximating `setImmediate`) allows the engine to process other events, updates, or re-renders in between checks. See - element-hq/element-web#21612 - element-hq/element-web#11836 Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
Currently, calling `Client#prepareToEncrypt` in a megolm room has the potential to block for multiple seconds while it crunches numbers. Sleeping for 0 seconds (approximating `setImmediate`) allows the engine to process other events, updates, or re-renders in between checks. See - element-hq/element-web#21612 - element-hq/element-web#11836 Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
Steps to reproduce
Type a new message.
Outcome
What did you expect?
The message appears immediately while typing.
What happened instead?
The page blocks and the message appears seconds after typing.
The keydown event handler ist blocking for several seconds, caused by getDevicesInRoom(). Please find attached a screenshot of the performance inspector.
Operating system
Linux
Browser information
Version 99.0.4844.74 (Official Build) (64-bit)
URL for webapp
No response
Application version
Element Version: 1.10.7 Olm Version: 3.2.8
Homeserver
Synapse 1.55.0
Will you send logs?
No
The text was updated successfully, but these errors were encountered: