Bug 82621 - Web Inspector: check more likely condition first in HeapSnapshot._buildAggregates
Summary: Web Inspector: check more likely condition first in HeapSnapshot._buildAggreg...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Yury Semikhatsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-29 09:06 PDT by Yury Semikhatsky
Modified: 2012-03-29 09:25 PDT (History)
12 users (show)

See Also:


Attachments
Patch (5.24 KB, patch)
2012-03-29 09:10 PDT, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (4.36 KB, patch)
2012-03-29 09:14 PDT, Yury Semikhatsky
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>