RESOLVED FIXED 157535
Web Inspector: Avoid unnecessary timeout identifier churn in TimelineManager
https://bugs.webkit.org/show_bug.cgi?id=157535
Summary Web Inspector: Avoid unnecessary timeout identifier churn in TimelineManager
Joseph Pecoraro
Reported 2016-05-10 14:31:47 PDT
* SUMMARY Avoid unnecessary timeout identifier churn in TimelineManager. The _deadTimeTimeout can get churned thousands of times (4000+ on theverge.com) because a bunch of records are added at once. Reduce the churn on the timeout identifier (<100), which also slightly reduces the amount of time spent in _resetAutoRecordingDeadTimeTimeout.
Attachments
[PATCH] Proposed Fix (2.58 KB, patch)
2016-05-10 14:32 PDT, Joseph Pecoraro
timothy: review+
[PATCH] For Landing (2.62 KB, patch)
2016-05-10 17:26 PDT, Joseph Pecoraro
no flags
Joseph Pecoraro
Comment 1 2016-05-10 14:32:53 PDT
Created attachment 278531 [details] [PATCH] Proposed Fix
Joseph Pecoraro
Comment 2 2016-05-10 14:35:09 PDT
Comment on attachment 278531 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=278531&action=review > Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js:744 > + let now = Date.now(); > + if (now <= this._lastDeadTimeTickle + 10) > + return; > + > + this._lastDeadTimeTickle = now; We could make the this._lastDeadTimeTickle = now + 10. And eliminate the "+ 10", thereby eliminating the add every check. But it felt less clear. Still the time spent in this was only ~5ms on a long recording on theverge, so not very important.
Matt Baker
Comment 3 2016-05-10 15:01:33 PDT
Comment on attachment 278531 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=278531&action=review > Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js:741 > + if (now <= this._lastDeadTimeTickle + 10) Magic number: a comment at the end of the line or a const on the line above would help clarify the 10.
Timothy Hatcher
Comment 4 2016-05-10 15:51:36 PDT
Comment on attachment 278531 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=278531&action=review > Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js:740 > + let now = Date.now(); performance.now? >> Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js:744 >> + this._lastDeadTimeTickle = now; > > We could make the this._lastDeadTimeTickle = now + 10. And eliminate the "+ 10", thereby eliminating the add every check. But it felt less clear. Still the time spent in this was only ~5ms on a long recording on theverge, so not very important. I think putting the + 10 here makes more sense.
Joseph Pecoraro
Comment 5 2016-05-10 17:26:33 PDT
Created attachment 278555 [details] [PATCH] For Landing
WebKit Commit Bot
Comment 6 2016-05-10 17:55:57 PDT
Comment on attachment 278555 [details] [PATCH] For Landing Clearing flags on attachment: 278555 Committed r200661: <http://trac.webkit.org/changeset/200661>
Note You need to log in before you can comment on or make changes to this bug.