mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
Don't re-compute display time when rendering a message a second time
Adding the display times to messages is very expensive (> 1s for 400 messages in Chrome on my machine). This commit doesn't directly address that issue, but does mitigate its affects on scrolling speed when rendering the next chunk of the message list. After this commit, rendering a portion of the message list for the second time only takes ~300ms. (imported from commit b22badb5dcce69be297f6403b1cb40950e46376e)
This commit is contained in:
@@ -16,6 +16,9 @@ function MessageList(table_name, opts) {
|
||||
(function () {
|
||||
|
||||
function add_display_time(message, prev) {
|
||||
if (message.timestr !== undefined) {
|
||||
return;
|
||||
}
|
||||
var two_digits = function (x) { return ('0' + x).slice(-2); };
|
||||
var time = new XDate(message.timestamp * 1000);
|
||||
var include_date = message.include_recipient;
|
||||
|
||||
Reference in New Issue
Block a user