mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
blueslip: Add measure_time wrapper.
Now when we want to measure how long a block of code takes to execute, we just wrap it with `blueslip.measure_time`, instead of the awkward idiom from my original commit of getting a callback function. My rationale for the original scheme was that I wanted to minimize diffs and avoid changing `const` to `let` in a few cases, but I believe now that the function wrapper is nicer. In a few cases I just removed the blueslip timing code, since I was able to confirm on czo that the times were pretty minimal.
This commit is contained in:
@@ -314,9 +314,8 @@ function set_stream_unread_count(stream_id, count) {
|
||||
}
|
||||
|
||||
exports.update_streams_sidebar = function (force_rerender) {
|
||||
const finish = blueslip.start_timing("build_stream_list");
|
||||
exports.build_stream_list(force_rerender);
|
||||
finish();
|
||||
|
||||
exports.stream_cursor.redraw();
|
||||
|
||||
if (!narrow_state.active()) {
|
||||
|
||||
Reference in New Issue
Block a user