You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to decrypt encrypted messages to compute notifications and other things locally. But decryption uses CPU, about 5ms per decryption on an iPhoneX.
Currently, we decrypt all events received from an initial /sync. We can save some operations: this is useless to try to compute notifications on messages already read by the user.
An initial /sync on my account currently triggers 2179 decryptions, taking 12.4s (currently on the main thread). If I decrypt only messages that are newer than my read receipts, I decrypt 4 times less messages, 524, using 3.2 seconds of CPU.
So, the first step to improve this is to consider user read receipts before decrypting.
We probably need to decrypt messages that occurred a bit before to handle correctly call signalling in case the user switches devices. If the RR happened at t0, we should decrypt messages newer than t0 - 2min (incoming call life time is 1min, the RR can appear 59s after the incoming call event).
The text was updated successfully, but these errors were encountered:
We need to decrypt encrypted messages to compute notifications and other things locally. But decryption uses CPU, about 5ms per decryption on an iPhoneX.
Currently, we decrypt all events received from an initial /sync. We can save some operations: this is useless to try to compute notifications on messages already read by the user.
An initial /sync on my account currently triggers 2179 decryptions, taking 12.4s (currently on the main thread). If I decrypt only messages that are newer than my read receipts, I decrypt 4 times less messages, 524, using 3.2 seconds of CPU.
So, the first step to improve this is to consider user read receipts before decrypting.
We probably need to decrypt messages that occurred a bit before to handle correctly call signalling in case the user switches devices. If the RR happened at t0, we should decrypt messages newer than t0 - 2min (incoming call life time is 1min, the RR can appear 59s after the incoming call event).
The text was updated successfully, but these errors were encountered: