Optimize unreads model on mark-as-read #332
Labels
a-model
Implementing our data model (PerAccountStore, etc.)
performance
Smooth and responsive UI; fixing jank, stutters, and lag
Milestone
In #304 we implemented the
Unreads
model, and measured that its performance was quite fast for most operations, but not for marking messages as read. The timings are in the series of messages starting at #304 (comment) .In particular, in those experiments it took 0ms (to the nearest ms) to construct the whole model in the first place, as well as most other operations. But it took about 14ms for a mark-as-read event, whether for marking one or many individual messages as read.
As I said at #304 (comment) :
The first step here is probably to profile to see specifically where the time is being spent, e.g. to get a flame chart:
https://docs.flutter.dev/tools/devtools/cpu-profiler#flame-chart
(My original suggestion at #304 (comment) didn't seem to help, or not much. That was without the benefit of profiling.)
Given that the existing code is already much faster at constructing the whole model from scratch than it is at handling mark-as-read, I'm expecting that there'll turn out to be a way to make this much faster without needing the deeper data-structure changes described at zulip/zulip-mobile#4684 . If we do need the latter (or do eventually pursue those too, for the sake of going even faster), then that will be a post-launch task.
The text was updated successfully, but these errors were encountered: