From 8f7170a4a161012ee3f84d6214836a8fc31cf1e6 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 25 Mar 2019 12:45:51 +0100 Subject: [PATCH] add timeline profiling markers when updateheight and onscroll run --- src/components/structures/ScrollPanel.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/structures/ScrollPanel.js b/src/components/structures/ScrollPanel.js index f00ff40155..ccf2e06f9f 100644 --- a/src/components/structures/ScrollPanel.js +++ b/src/components/structures/ScrollPanel.js @@ -195,6 +195,7 @@ module.exports = React.createClass({ this._saveScrollState(); this.checkFillState(); this.updatePreventShrinking(); + console.timeStamp("onScroll:" + JSON.stringify({st: this._getScrollNode().scrollTop, mh: this._getMessagesHeight(), lh: this._getListHeight()})); this.props.onScroll(ev); }, @@ -596,6 +597,7 @@ module.exports = React.createClass({ const bottomDiff = newBottomOffset - scrollState.bottomOffset; this._bottomGrowth += bottomDiff; scrollState.bottomOffset = newBottomOffset; + console.timeStamp("restoreSavedScrollState:" + JSON.stringify({bd: bottomDiff, lh: this._getListHeight()})); itemlist.style.height = `${this._getListHeight()}px`; debuglog("balancing height because messages below viewport grew by "+bottomDiff+"px"); } @@ -635,6 +637,7 @@ module.exports = React.createClass({ itemlist.style.height = `${newHeight}px`; sn.scrollTop = sn.scrollHeight; debuglog("updateHeight to", newHeight); + console.timeStamp("updateHeight: to bottom"); } else if (scrollState.trackedScrollToken) { const trackedNode = this._getTrackedNode(); // if the timeline has been reloaded @@ -654,6 +657,7 @@ module.exports = React.createClass({ const topDiff = newTop - oldTop; sn.scrollTop = preexistingScrollTop + topDiff; debuglog("updateHeight to", {newHeight, topDiff, preexistingScrollTop}); + console.timeStamp("updateHeight:" + JSON.stringify({nh: newHeight, td: topDiff, st: preexistingScrollTop})); } } },