-
-
Notifications
You must be signed in to change notification settings - Fork 674
Description
The code we have under src/unread/
, and in particular the various "reducer" files, exists for the purpose of tracking what unread messages exist.
When we did some profiling a couple of months ago, we learned that one of the really slow spots in the app is how that code handles when some messages get marked as read. On a recent high-end phone, with a test user on CZO who had a lot of unreads, we spent 80ms inside the unread
reducer code.
We also spent another 217ms outside the reducers in other steps of dispatching the Redux action for that event; we haven't worked out where all that time goes, but I suspect that much of it was either in the related unreadSelectors
code, or in React responding to changes in that data. The job of the unread-model code as a whole is basically to support efficient implementations of those tasks, so if those are inefficient then the solution for that too is likely to lie partly in changes to the unread model.
Some more discussion of the problem is in the description of #4400, which made some preparatory changes for fixing it.
This is related to #3339 and #3949. As part of the solution, we'll want to convert those state.unread
data structures to use Immutable.js, following #4390, #4392, and #4201. In addition to #4400, I've just sent #4437 as a second round of preparation.