Title: [198518] trunk/Websites/perf.webkit.org
Revision
198518
Author
rn...@webkit.org
Date
2016-03-21 19:58:19 -0700 (Mon, 21 Mar 2016)

Log Message

Commit log viewer repaints too frequently after r198499
https://bugs.webkit.org/show_bug.cgi?id=155732

Reviewed by Joseph Pecoraro.

The bug was caused by InteractiveTimeSeriesChart invoking onchange callback whenever mouse moved even
if the current point didn't change. Fixed the bug by avoiding the work if the indicator hadn't changed
and avoiding work in the commit log viewer when the requested repository and the revision range were
the same as those of the last request.

* public/v3/components/commit-log-viewer.js:
(CommitLogViewer):
(CommitLogViewer.prototype.currentRepository): Exit early when repository and the revision range are
identical to the one we already have to avoid repaints and issuing multiple network requests.
* public/v3/components/interactive-time-series-chart.js:
(InteractiveTimeSeriesChart.prototype._mouseMove): Don't invoke _notifyIndicatorChanged if the current
indicator hadn't changed.
* public/v3/pages/chart-pane.js:
(ChartPane.prototype._indicatorDidChange): Fixed the bug that unlocking the indicator wouldn't update
the URL. We need to check whether the lock state had changed. The old condition was also redundant
since _mainChartIndicatorWasLocked is always identically equal to isLocked per the prior assignment.

Modified Paths

Diff

Modified: trunk/Websites/perf.webkit.org/ChangeLog (198517 => 198518)


--- trunk/Websites/perf.webkit.org/ChangeLog	2016-03-22 01:53:50 UTC (rev 198517)
+++ trunk/Websites/perf.webkit.org/ChangeLog	2016-03-22 02:58:19 UTC (rev 198518)
@@ -1,5 +1,29 @@
 2016-03-21  Ryosuke Niwa  <rn...@webkit.org>
 
+        Commit log viewer repaints too frequently after r198499
+        https://bugs.webkit.org/show_bug.cgi?id=155732
+
+        Reviewed by Joseph Pecoraro.
+
+        The bug was caused by InteractiveTimeSeriesChart invoking onchange callback whenever mouse moved even
+        if the current point didn't change. Fixed the bug by avoiding the work if the indicator hadn't changed
+        and avoiding work in the commit log viewer when the requested repository and the revision range were
+        the same as those of the last request.
+
+        * public/v3/components/commit-log-viewer.js:
+        (CommitLogViewer):
+        (CommitLogViewer.prototype.currentRepository): Exit early when repository and the revision range are
+        identical to the one we already have to avoid repaints and issuing multiple network requests.
+        * public/v3/components/interactive-time-series-chart.js:
+        (InteractiveTimeSeriesChart.prototype._mouseMove): Don't invoke _notifyIndicatorChanged if the current
+        indicator hadn't changed.
+        * public/v3/pages/chart-pane.js:
+        (ChartPane.prototype._indicatorDidChange): Fixed the bug that unlocking the indicator wouldn't update
+        the URL. We need to check whether the lock state had changed. The old condition was also redundant
+        since _mainChartIndicatorWasLocked is always identically equal to isLocked per the prior assignment.
+
+2016-03-21  Ryosuke Niwa  <rn...@webkit.org>
+
         Fix A/B testing after r198503.
 
         * public/include/build-requests-fetcher.php:

Modified: trunk/Websites/perf.webkit.org/public/v3/components/commit-log-viewer.js (198517 => 198518)


--- trunk/Websites/perf.webkit.org/public/v3/components/commit-log-viewer.js	2016-03-22 01:53:50 UTC (rev 198517)
+++ trunk/Websites/perf.webkit.org/public/v3/components/commit-log-viewer.js	2016-03-22 02:58:19 UTC (rev 198518)
@@ -7,13 +7,21 @@
         this._repository = null;
         this._fetchingPromise = null;
         this._commits = null;
+        this._from = null;
+        this._to = null;
     }
 
     currentRepository() { return this._repository; }
 
     view(repository, from, to)
     {
+        if (this._repository == repository && this._from == from && this._to == to)
+            return Promise.resolve(null);
+
         this._commits = null;
+        this._repository = repository;
+        this._from = from;
+        this._to = to;
 
         if (!repository) {
             this._fetchingPromise = null;
@@ -21,8 +29,6 @@
             return Promise.resolve(null);
         }
 
-        this._repository = repository;
-
         if (!to) {
             this._fetchingPromise = null;
             this.render();

Modified: trunk/Websites/perf.webkit.org/public/v3/components/interactive-time-series-chart.js (198517 => 198518)


--- trunk/Websites/perf.webkit.org/public/v3/components/interactive-time-series-chart.js	2016-03-22 01:53:50 UTC (rev 198517)
+++ trunk/Websites/perf.webkit.org/public/v3/components/interactive-time-series-chart.js	2016-03-22 02:58:19 UTC (rev 198518)
@@ -175,13 +175,21 @@
 
         var oldIndicatorID = this._indicatorID;
 
-        this._currentAnnotation = this._findAnnotation(cursorLocation);
+        var newAnnotation = this._findAnnotation(cursorLocation);
+        var newIndicatorID = null;
         if (this._currentAnnotation)
-            this._indicatorID = null;
+            newIndicatorID = null;
         else
-            this._indicatorID = this._findClosestPoint(cursorLocation);
+            newIndicatorID = this._findClosestPoint(cursorLocation);
 
         this._forceRender = true;
+
+        if (this._currentAnnotation == newAnnotation && this._indicatorID == newIndicatorID)
+            return;
+
+        this._currentAnnotation = newAnnotation;
+        this._indicatorID = newIndicatorID;
+
         this._notifyIndicatorChanged();
     }
 

Modified: trunk/Websites/perf.webkit.org/public/v3/pages/chart-pane.js (198517 => 198518)


--- trunk/Websites/perf.webkit.org/public/v3/pages/chart-pane.js	2016-03-22 01:53:50 UTC (rev 198517)
+++ trunk/Websites/perf.webkit.org/public/v3/pages/chart-pane.js	2016-03-22 02:58:19 UTC (rev 198518)
@@ -82,8 +82,8 @@
 
     _indicatorDidChange(indicatorID, isLocked)
     {
+        this._chartsPage.mainChartIndicatorDidChange(this, isLocked != this._mainChartIndicatorWasLocked);
         this._mainChartIndicatorWasLocked = isLocked;
-        this._chartsPage.mainChartIndicatorDidChange(this, isLocked || this._mainChartIndicatorWasLocked);
         super._indicatorDidChange(indicatorID, isLocked);
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to