Bug 82621

Summary: Web Inspector: check more likely condition first in HeapSnapshot._buildAggregates
Product: WebKit Reporter: Yury Semikhatsky <yurys>
Component: Web Inspector (Deprecated)Assignee: Yury Semikhatsky <yurys>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, tkent, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch pfeldman: review+

Description Yury Semikhatsky 2012-03-29 09:06:41 PDT
Check more likely condition first in HeapSnapshot._buildAggregates.
Comment 1 Yury Semikhatsky 2012-03-29 09:10:46 PDT
Created attachment 134597 [details]
Patch
Comment 2 Yury Semikhatsky 2012-03-29 09:12:54 PDT
(In reply to comment #1)
> Created an attachment (id=134597) [details]
> Patch

Results of PerformanceTests/inspector/detailed-heapshots-smoke-test.html

With the patch applied:
RESULT heap-snapshot: _buildAggregates= 4565 ms
RESULT heap-snapshot: switch-to-containment-view= 4901 ms

Without the patch:
RESULT heap-snapshot: _buildAggregates= 5593 ms
RESULT heap-snapshot: switch-to-containment-view= 5838 ms
Comment 3 Yury Semikhatsky 2012-03-29 09:14:35 PDT
Created attachment 134598 [details]
Patch
Comment 4 Pavel Feldman 2012-03-29 09:16:44 PDT
Comment on attachment 134598 [details]
Patch

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

> Source/WebCore/inspector/front-end/HeapSnapshot.js:1094
> +            if (node.selfSize === 0 && !node.isNative)

We don't compare to 0 in WebKit, use !node.selfSize.
Comment 5 Yury Semikhatsky 2012-03-29 09:21:39 PDT
(In reply to comment #4)
> (From update of attachment 134598 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=134598&action=review
> 
> > Source/WebCore/inspector/front-end/HeapSnapshot.js:1094
> > +            if (node.selfSize === 0 && !node.isNative)
> 
> We don't compare to 0 in WebKit, use !node.selfSize.

Done.
Comment 6 Yury Semikhatsky 2012-03-29 09:25:44 PDT
Committed r112540: <http://trac.webkit.org/changeset/112540>