matrix-org / matrix-org/matrix-ios-sdk
MXFileStore: Less threads switching
- Dominant language
- Objective-C
- Stars
- 484
- Forks
- 225
- PR merge metrics
- No merged PRs in 30d
Description
Each [MXFileStore saveXXX] operation (they are currently 7 save operations: saveRoomsMessages, saveRoomsState, ... ) posts a block on the file store processing queue.
That means that for one [MXFileStore commit], we can launch 7 times the file store processing queue thread. (This is actually 8 because the [MXFileStore commit] does an additional dispatch_async).
That makes a lot of thread switching which can penalise performance.
The code can be refactored to go only once on the file store processing queue.
Contributor guide
Research direction
Start by locating MXFileStore and reading the saveRoomsMessages, saveRoomsState, and other saveXXX operations together with MXFileStore commit. Trace where each operation dispatches to the file store processing queue, then verify that one commit uses a single queue dispatch while preserving the existing save behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- objective-c
- Domain
- performance
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100