Bug 87124

Summary: Web Inspector: HeapSnapshot: speed-up calculateRetainedSize functon.
Product: WebKit Reporter: Ilya Tikhonovsky <loislo>
Component: Web Inspector (Deprecated)Assignee: Ilya Tikhonovsky <loislo>
Status: RESOLVED FIXED    
Severity: Normal CC: alph, apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 87107    
Attachments:
Description Flags
Patch yurys: review+

Description Ilya Tikhonovsky 2012-05-22 05:54:59 PDT
I found that in all dominators related functions we use nodeOrdinals.
At the moment we divide nodeIndex to nodeFieldCount and this operation too expensive for these simple algorithms.
Comment 1 Ilya Tikhonovsky 2012-05-22 06:03:31 PDT
RESULT heap-snapshot: _calculateRetainedSizes= 245 ms
RESULT heap-snapshot: _buildDominatedNodes= 33 ms

vs

RESULT heap-snapshot: _calculateRetainedSizes= 87 ms
RESULT heap-snapshot: _buildDominatedNodes= 15 ms
Comment 2 Ilya Tikhonovsky 2012-05-22 06:11:54 PDT
Created attachment 143290 [details]
Patch
Comment 3 Yury Semikhatsky 2012-05-22 06:14:50 PDT
Comment on attachment 143290 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=143290&action=review

> Source/WebCore/inspector/front-end/HeapSnapshot.js:462
> +        return this._snapshot._dominatorsTree[this.nodeIndex / this._snapshot._nodeFieldCount] * nodeFieldCount;

this._snapshot._nodeFieldCount ->  nodeFieldCount
Comment 4 Ilya Tikhonovsky 2012-05-22 06:25:10 PDT
Committed r117962: <http://trac.webkit.org/changeset/117962>