Bug 87107

Summary: Web Inspector: HeapProfiler: upstream retainedSize calculation.
Product: WebKit Reporter: Ilya Tikhonovsky <loislo>
Component: Web Inspector (Deprecated)Assignee: Ilya Tikhonovsky <loislo>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 87124    
Bug Blocks: 87089    
Attachments:
Description Flags
Patch yurys: review+

Description Ilya Tikhonovsky 2012-05-22 02:57:48 PDT
See Bug 87089 - Web Inspector: MetaBug: upstream backend post-processing methods to the front-end.

JS implementation is a bit slow.
RESULT heap-snapshot: _calculateRetainedSizes= 266 ms

vs native

HeapSnapshotGenerator::CalculateRetainedSizes 61 ms

I'll make it twice faster, about 130ms in the next patch.
Comment 1 Ilya Tikhonovsky 2012-05-22 03:09:16 PDT
Created attachment 143248 [details]
Patch
Comment 2 Yury Semikhatsky 2012-05-22 04:31:43 PDT
Comment on attachment 143248 [details]
Patch

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

> Source/WebCore/inspector/front-end/HeapSnapshot.js:1270
> +            var nodeSelfSize = nodes[nodeOrdinal * nodeFieldCount + nodeSelfSizeOffset];

You can introduce a var for nodeSelfSizeIndex and use an increment to keep it up to date.

> Source/WebCore/inspector/front-end/HeapSnapshot.js:1276
> +            } while (currentNodeOrdinal !== prevNodeOrdinal);

while (currentNodeOrdinal) would work as well as the root index is 0.
Comment 3 Ilya Tikhonovsky 2012-05-22 04:54:09 PDT
Committed r117953: <http://trac.webkit.org/changeset/117953>
Comment 4 Ilya Tikhonovsky 2012-05-22 07:21:19 PDT
(In reply to comment #0)
> See Bug 87089 - Web Inspector: MetaBug: upstream backend post-processing methods to the front-end.
> 
> JS implementation is a bit slow.
> RESULT heap-snapshot: _calculateRetainedSizes= 266 ms
> 
> vs native
> 
> HeapSnapshotGenerator::CalculateRetainedSizes 61 ms
> 
> I'll make it twice faster, about 130ms in the next patch.

Bug 87124 - Web Inspector: HeapSnapshot: speed-up calculateRetainedSize functon.
landed as r117962