Title: [200772] trunk/Source/WebInspectorUI
Revision
200772
Author
[email protected]
Date
2016-05-12 08:42:37 -0700 (Thu, 12 May 2016)

Log Message

Web Inspector: Reduce rAF churn in DefaultDashboardView on pages with lots of resources
https://bugs.webkit.org/show_bug.cgi?id=157618

Patch by Joseph Pecoraro <[email protected]> on 2016-05-12
Reviewed by Timothy Hatcher.

* UserInterface/Views/DefaultDashboardView.js:
(WebInspector.DefaultDashboardView):
(WebInspector.DefaultDashboardView.prototype._updateDisplaySoon):
(WebInspector.DefaultDashboardView.prototype._updateDisplay):
Previously we were scheduling multiple rAFs that would all fire with
the same data, each time a resource was added. Coalesce into one.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (200771 => 200772)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-05-12 15:25:58 UTC (rev 200771)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-05-12 15:42:37 UTC (rev 200772)
@@ -1,3 +1,17 @@
+2016-05-12  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Reduce rAF churn in DefaultDashboardView on pages with lots of resources
+        https://bugs.webkit.org/show_bug.cgi?id=157618
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/DefaultDashboardView.js:
+        (WebInspector.DefaultDashboardView):
+        (WebInspector.DefaultDashboardView.prototype._updateDisplaySoon):
+        (WebInspector.DefaultDashboardView.prototype._updateDisplay):
+        Previously we were scheduling multiple rAFs that would all fire with
+        the same data, each time a resource was added. Coalesce into one.
+
 2016-05-12  Matt Baker  <[email protected]>
 
         Web Inspector: Improve snapshot selection in heap allocations overview graph

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DefaultDashboardView.js (200771 => 200772)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DefaultDashboardView.js	2016-05-12 15:25:58 UTC (rev 200771)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DefaultDashboardView.js	2016-05-12 15:42:37 UTC (rev 200772)
@@ -29,7 +29,8 @@
     {
         super(representedObject, "default");
 
-        representedObject.addEventListener(WebInspector.DefaultDashboard.Event.DataDidChange, window.requestAnimationFrame.bind(null, this._updateDisplay.bind(this)));
+        representedObject.addEventListener(WebInspector.DefaultDashboard.Event.DataDidChange, () => { this._updateDisplaySoon() });
+        this._scheduledUpdateIdentifier = undefined;
 
         this._items = {
             resourcesCount: {
@@ -64,8 +65,18 @@
     
     // Private
 
+    _updateDisplaySoon()
+    {
+        if (this._scheduledUpdateIdentifier)
+            return;
+
+        this._scheduledUpdateIdentifier = requestAnimationFrame(this._updateDisplay.bind(this));
+    }
+
     _updateDisplay()
     {
+        this._scheduledUpdateIdentifier = undefined;
+
         var dashboard = this.representedObject;
 
         for (var category of ["logs", "issues", "errors"])
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to