element-hq / element-hq/element-ios
Fixing missing room summary last messages slows down the initial sync
- Dominant language
- Swift
- Stars
- 1.8k
- Forks
- 544
- PR merge metrics
- PR metrics pending
Description
### Steps to reproduce
After this [PR](https://github.com/matrix-org/matrix-ios-sdk/pull/1096), last year, an initial sync required 467 decryptions on a 600 room account, using 2.8s of an iPhoneX CPU.
1.8.17 requires now 4643 decryptions for a 850 room account. They use 120s of iPhone 13 CPU before this fix for https://github.com/vector-im/element-ios/issues/6239 (Maybe 25s now).
But we are still comparing 2.8s of iPhoneX with 25s of iPhone 13.
The change comes from https://github.com/matrix-org/matrix-ios-sdk/pull/1206/commits/1f9d638863ad6666a5b131c8a8a4acfa7f1c59be?diff=split&w=1 that transforms the lazy fix of room summaries by a mandatory step.
This step is expansive. It fetches (and decrypts) 50 messages per problematic rooms.
### Outcome
Reduce the number of required decryptions during an initial sync.
### Your phone model
_No response_
### Operating system version
_No response_
### Application version
_No response_
### Homeserver
_No response_
### Will you send logs?
No
Contributor guide
Assessment
This issue has not been assessed yet.