Title: [200661] trunk/Source/WebInspectorUI
- Revision
- 200661
- Author
- [email protected]
- Date
- 2016-05-10 17:56:45 -0700 (Tue, 10 May 2016)
Log Message
Web Inspector: Avoid unnecessary timeout identifier churn in TimelineManager
https://bugs.webkit.org/show_bug.cgi?id=157535
Patch by Joseph Pecoraro <[email protected]> on 2016-05-10
Reviewed by Timothy Hatcher.
* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager):
(WebInspector.TimelineManager.prototype.capturingStarted):
(WebInspector.TimelineManager.prototype._resetAutoRecordingDeadTimeTimeout):
Don't re-tickle if we tickled in the last 10ms.
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (200660 => 200661)
--- trunk/Source/WebInspectorUI/ChangeLog 2016-05-11 00:20:10 UTC (rev 200660)
+++ trunk/Source/WebInspectorUI/ChangeLog 2016-05-11 00:56:45 UTC (rev 200661)
@@ -1,3 +1,16 @@
+2016-05-10 Joseph Pecoraro <[email protected]>
+
+ Web Inspector: Avoid unnecessary timeout identifier churn in TimelineManager
+ https://bugs.webkit.org/show_bug.cgi?id=157535
+
+ Reviewed by Timothy Hatcher.
+
+ * UserInterface/Controllers/TimelineManager.js:
+ (WebInspector.TimelineManager):
+ (WebInspector.TimelineManager.prototype.capturingStarted):
+ (WebInspector.TimelineManager.prototype._resetAutoRecordingDeadTimeTimeout):
+ Don't re-tickle if we tickled in the last 10ms.
+
2016-05-10 Matt Baker <[email protected]>
Web Inspector: Can't select record bar in Frames timeline
Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (200660 => 200661)
--- trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js 2016-05-11 00:20:10 UTC (rev 200660)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js 2016-05-11 00:56:45 UTC (rev 200661)
@@ -51,6 +51,10 @@
this._webTimelineScriptRecordsExpectingScriptProfilerEvents = null;
this._scriptProfilerRecords = null;
+ this._stopCapturingTimeout = undefined;
+ this._deadTimeTimeout = undefined;
+ this._lastDeadTimeTickle = 0;
+
this.reset();
}
@@ -219,6 +223,8 @@
this._isCapturing = true;
+ this._lastDeadTimeTickle = 0;
+
if (startTime)
this.activeRecording.initializeTimeBoundsIfNecessary(startTime);
@@ -730,6 +736,12 @@
if (!this._isCapturing || !this._mainResourceForAutoCapturing)
return;
+ // Avoid unnecessary churning of timeout identifier by not tickling until 10ms have passed.
+ let now = Date.now();
+ if (now <= this._lastDeadTimeTickle)
+ return;
+ this._lastDeadTimeTickle = now + 10;
+
if (this._deadTimeTimeout)
clearTimeout(this._deadTimeTimeout);
this._deadTimeTimeout = setTimeout(this._boundStopCapturing, WebInspector.TimelineManager.DeadTimeRequiredToStopAutoRecordingEarly);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes