Bug 174968

Summary: Web Inspector: add TreeElement virtualization for the Recording tab
Product: WebKit Reporter: Devin Rousso <hi>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, inspector-bugzilla-changes, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on: 174484    
Bug Blocks: 173807, 176547, 183015, 188959, 188960    
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews115 for mac-elcapitan
none
Patch none

Devin Rousso
Reported 2017-07-28 22:16:11 PDT
When a single frame has over ~3000 actions, it becomes very slow, bordering on unusable. The main reason for this slowdown is the massive number of DOM elements, so adding/removing them depending on what's visible (plus some extra buffer) would drastically improve performance.
Attachments
Patch (10.29 KB, patch)
2017-08-01 23:48 PDT, Devin Rousso
no flags
Archive of layout-test-results from ews115 for mac-elcapitan (2.07 MB, application/zip)
2017-08-02 08:59 PDT, Build Bot
no flags
Patch (10.53 KB, patch)
2017-08-02 20:39 PDT, Devin Rousso
no flags
Devin Rousso
Comment 1 2017-08-01 23:48:46 PDT
Build Bot
Comment 2 2017-08-02 08:59:04 PDT
Comment on attachment 316936 [details] Patch Attachment 316936 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/4240134 New failing tests: fast/dom/Window/HTMLBodyElement-window-eventListener-attributes.html
Build Bot
Comment 3 2017-08-02 08:59:05 PDT
Created attachment 316964 [details] Archive of layout-test-results from ews115 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Devin Rousso
Comment 4 2017-08-02 11:00:35 PDT
Comment on attachment 316936 [details] Patch Unrelated test failure.
Joseph Pecoraro
Comment 5 2017-08-02 20:14:39 PDT
Comment on attachment 316936 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=316936&action=review r=me, we should apply this to the CallStackTreeOutline in the debugger tab, which will need narrowing down of the scroll container. > Source/WebInspectorUI/ChangeLog:18 > + the TreeOutline node still takes up the same amount of space after some of the TreeElement's Grammar: "TreeElement's" => "TreeElements" > Source/WebInspectorUI/UserInterface/Views/TreeElement.js:466 > + if (this.treeOutline) > + this.treeOutline.updateVirtualizedElements(this); Move this after the onreveal. > Source/WebInspectorUI/UserInterface/Views/TreeOutline.js:648 > + if (isNaN(treeItemHeight)) Just console.assert !NaN > Source/WebInspectorUI/UserInterface/Views/TreeOutline.js:666 > + function walk(parent, callback) { When walk recurses, the shouldReturn callback might return `true`, and then we will continue to walk when we un-nest the recursion. You can solve this with 2 return values: {shouldReturn, count} Or avoid recursion and do some cool iterative stack based solution. > Source/WebInspectorUI/UserInterface/Views/TreeOutline.js:688 > + let extraRows = Math.max(numberToShow * 5, 50); This variable name is vague since you end up doing (extraRows * 2) all over the place. This is the number of pad rows you are applying to each side. > Source/WebInspectorUI/UserInterface/Views/TreeOutline.js:697 > + let index = walk(this, ({treeElement, count}) => { > + if (treeElement === focusedTreeElement) > + return true; > + return false; > + }); Style: Simplify this let index = walk(this, ({treeElement}) => treeElement === focusedTreeElement); > Source/WebInspectorUI/UserInterface/Views/TreeOutline.js:703 > + } > + else if (index > lastItem) { Style: else on the same line > Source/WebInspectorUI/UserInterface/Views/TreeOutline.js:720 > + this._virtualizedTopSpacer.style.setProperty("height", (Math.max(firstItem, 0) * this._virtualizedTreeItemHeight) + "px"); Why not just: style.height = ...;
Devin Rousso
Comment 6 2017-08-02 20:39:11 PDT
WebKit Commit Bot
Comment 7 2017-08-02 21:21:35 PDT
Comment on attachment 317082 [details] Patch Clearing flags on attachment: 317082 Committed r220180: <http://trac.webkit.org/changeset/220180>
WebKit Commit Bot
Comment 8 2017-08-02 21:21:37 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 9 2017-08-02 21:22:31 PDT
Note You need to log in before you can comment on or make changes to this bug.