blueslip: Add feature to time common operations.

This is relatively unobtrusive, and we don't send
anything to the server.

But any user can now enter blueslip.timings in the
console to see a map of how long things take in
milliseconds.  We only record one timing per
event label (i.e. the most recent).

It's pretty easy to test this by just clicking
around.  For 300 users/streams most things are
fast except for:

    - initialize_everything
    - manage streams (render_subscriptions)

Both do lots of nontrivial work, although
"manage streams" is a bit surprising, since
we're only measuring how long to build the
HTML from the templates (whereas the real
time is probably browser rendering costs).
This commit is contained in:
Steve Howell
2020-01-15 14:05:44 +00:00
committed by Tim Abbott
parent b8f9f6018a
commit 0aa9decd86
12 changed files with 37 additions and 0 deletions

View File

@@ -205,9 +205,11 @@ exports.build_user_sidebar = function () {
const user_ids = buddy_data.get_filtered_and_sorted_user_ids(filter_text);
const finish = blueslip.start_timing('buddy_list.populate');
buddy_list.populate({
keys: user_ids,
});
finish();
resize.resize_page_components();