-
-
Notifications
You must be signed in to change notification settings - Fork 677
Description
Currently, we load the webview with all of the messages that we know about for the relevant narrow. It turns out that a significant portion of the load time is based on the amount of content we send in the HTML body:
(in that chart, endTime is the value of performance.now()
at the end of js.js
(which is currently a reasonable proxy for load time), and numPieceDescriptors is the number of HtmlPieceDescriptors we send into the webivew with the initial HTML bundle)
Instead of sending all of the messages we know about, we should just send 10 or so messages around the message that we're scrolling the user to. (This number should be based on how many messages will fit on the screen, although we don't know the vertical size of messages until we render them, so we'll have to resort mostly to guessing).
If the user has unread messages, we should make sure that we're mostly sending over the messages below the anchor message, since we expect them to scroll down. We should probably send one or two messages above that as well, though.
In the case where we don't send all of the messages with the initial HTML bundle, we should immediately send a content event with the other messages that we know about. This will be improved when we implement #3851, although I don't think that's a blocker.
It's probably good to implement this before we implement #4641.