Bug 158491 - Web Inspector: reduce timer churn when processing many DOM.attributeModified messages
Summary: Web Inspector: reduce timer churn when processing many DOM.attributeModified ...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Local Build
Hardware: All All
: P2 Normal
Assignee: BJ Burg
Keywords: InRadar
Depends on:
Reported: 2016-06-07 13:36 PDT by BJ Burg
Modified: 2016-06-07 17:30 PDT (History)
8 users (show)

See Also:

Proposed Fix (7.15 KB, patch)
2016-06-07 13:57 PDT, BJ Burg
timothy: review+
bburg: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BJ Burg 2016-06-07 13:36:23 PDT
This patch fixes two issues at play in 142466 and 156250.

We currently use the Object.debounce/Object.soon proxy to try to coalesce calls to DOMTreeUpdater._attributesModified. Unfortunately, this doesn't coalesce very many calls because .soon is equivalent to using setTimeout(0). So we end up setting and clearing a timer for every attribute modification, and only coalesce calls until the timer fires. This means we also update the DOMTreeOutline multiple times per frame because this work is not done on a requestAnimationFrame, and the timer could fire many times in a frame's time slice.
Comment 1 BJ Burg 2016-06-07 13:36:37 PDT
Comment 2 BJ Burg 2016-06-07 13:57:22 PDT
Created attachment 280736 [details]
Proposed Fix
Comment 3 BJ Burg 2016-06-07 17:30:41 PDT
Committed r201778: <http://trac.webkit.org/changeset/201778>