From d4206f2f5f14c43c26d632c47b2f99eb07cbcd4c Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Mon, 20 Feb 2017 17:10:54 -0800 Subject: [PATCH] Speed up building user sidebar during page load. We now call activity.build_user_sidebar when we initialize the user sidebar, which avoids some janky jQuery code that was intended for partial updates. With 2000 users in dev, the amount of time to build the sidebar decreases from 1100ms to 700ms in my tests. (Times vary a bit, but it does seem consistently faster now.) --- static/js/activity.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/js/activity.js b/static/js/activity.js index 470f15902e..b895463ba2 100644 --- a/static/js/activity.js +++ b/static/js/activity.js @@ -458,8 +458,10 @@ exports.initialize = function () { focus_ping(); - activity.set_user_statuses(page_params.initial_presences, + activity.set_presence_info(page_params.initial_presences, page_params.initial_servertime); + exports.build_user_sidebar(); + exports.update_huddles(); }; // Set user statuses. `users` should be an object with user emails as keys