matrix-org / matrix-org/matrix-ios-sdk

MXFileStore: Less threads switching

Open
#271 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.