[webkit-changes] [WebKit/WebKit] a2b69f: Web Inspector: improve performance of `WI.OpenReso...

Devin Rousso noreply at github.com
Tue Mar 11 21:08:34 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a2b69f499e169dacc4ed01f1b698290a257c143c
      https://github.com/WebKit/WebKit/commit/a2b69f499e169dacc4ed01f1b698290a257c143c
  Author: Devin Rousso <hi at devinrousso.com>
  Date:   2025-03-11 (Tue, 11 Mar 2025)

  Changed paths:
    M Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js
    M Source/WebInspectorUI/UserInterface/Views/TreeOutline.js

  Log Message:
  -----------
  Web Inspector: improve performance of `WI.OpenResourceDialog`
https://bugs.webkit.org/show_bug.cgi?id=289036

Reviewed by BJ Burg.

These were discovered while debugging a website with a large number of resources (e.g. >10,000).

* Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype._populateResourceTreeOutline):
(WI.OpenResourceDialog.prototype.didPresentDialog):
The caller will already `WI.TreeOutline.prototype.removeChildren` so there's no need to check `WI.TreeOutline.prototype.findTreeElement`, especially since `WI.ResourceQueryController` shouldn't ever give the same `WI.Resource` more than once.
Also remove duplicate `Throttler.prototype.force` as it's already called by `WI.OpenResourceDialog.prototype._clear`.

* Source/WebInspectorUI/UserInterface/Views/TreeOutline.js:
(WI.TreeOutline):
(WI.TreeOutline.prototype.appendChild):
(WI.TreeOutline.prototype.insertChild):
(WI.TreeOutline.prototype.removeChildAtIndex):
(WI.TreeOutline.prototype.removeChildren):
(WI.TreeOutline.prototype._rememberTreeElementAndDescendants): Renamed from `_rememberTreeElement`.
(WI.TreeOutline.prototype._forgetTreeElementAndDescendants): Renamed from `_forgetTreeElement`.
(WI.TreeOutline.prototype.getCachedTreeElement):
(WI.TreeOutline.prototype._forgetChildrenRecursive): Deleted.
Use a `Multimap` instead of an object of arrays as that should be faster to insert/remove `WI.TreeElement`.
Don't call `Debouncer.prototype.delayForFrame` for each child that's added/removed as we only need to do it once for the overall operation.

Drive-by: remove unused `_cachedNumberOfDescendants`.
Canonical link: https://commits.webkit.org/291998@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list