Bug 83125 - Web Inspector: linearise aggregate's retaining size calculation
Summary: Web Inspector: linearise aggregate's retaining size calculation
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: Ilya Tikhonovsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-04 01:52 PDT by Ilya Tikhonovsky
Modified: 2012-04-04 08:50 PDT (History)
11 users (show)

See Also:


Attachments
Patch (3.89 KB, patch)
2012-04-04 01:55 PDT, Ilya Tikhonovsky
no flags Details | Formatted Diff | Diff
Patch (10.50 KB, patch)
2012-04-04 06:39 PDT, Ilya Tikhonovsky
no flags Details | Formatted Diff | Diff
Patch (11.53 KB, patch)
2012-04-04 07:55 PDT, Ilya Tikhonovsky
yurys: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Tikhonovsky 2012-04-04 01:52:08 PDT
It gives us no performance gain but gives us the flexibility for future improvements.
Comment 1 Ilya Tikhonovsky 2012-04-04 01:55:21 PDT
Created attachment 135529 [details]
Patch
Comment 2 Ilya Tikhonovsky 2012-04-04 06:39:40 PDT
Created attachment 135579 [details]
Patch
Comment 3 Yury Semikhatsky 2012-04-04 07:05:57 PDT
Comment on attachment 135579 [details]
Patch

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

> Source/WebCore/ChangeLog:15
> +2012-04-04  Ilya Tikhonovsky  <loislo@chromium.org>

Remove duplicate entry.

> Source/WebCore/inspector/front-end/HeapSnapshot.js:1136
> +        for (var nodeIndex = this._rootNodeIndex; nodeIndex < onlyNodesLength; nodeIndex += nodeFieldsCount) {

We may want to extract this loop into its own method so that we can measure its performance without _calculateClassesRetainedSize. WDYT?

> Source/WebCore/inspector/front-end/HeapSnapshot.js:1138
> +            var selfSize = onlyNodes[nodeIndex + selfSizeOffset];

Given that in other places here we use "node" to get corresponding field value I'd rather use it here as well for consistency. Does it have any impact on the performance of this method?

> Source/WebCore/inspector/front-end/HeapSnapshot.js:1195
> +            var dominatedIndexFrom = firstDominatedNodeIndex[nodeIndex / nodeFieldCount];

var nodeOrdinal = nodeIndex / nodeFieldCount; ?
Comment 4 Ilya Tikhonovsky 2012-04-04 07:55:21 PDT
Created attachment 135588 [details]
Patch
Comment 5 Ilya Tikhonovsky 2012-04-04 08:25:28 PDT
(In reply to comment #3)
> (From update of attachment 135579 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=135579&action=review
> 
> > Source/WebCore/ChangeLog:15
> > +2012-04-04  Ilya Tikhonovsky  <loislo@chromium.org (:loislo) (c)>
> 
> Remove duplicate entry.

done.

> 
> > Source/WebCore/inspector/front-end/HeapSnapshot.js:1136
> > +        for (var nodeIndex = this._rootNodeIndex; nodeIndex < onlyNodesLength; nodeIndex += nodeFieldsCount) {
> 
> We may want to extract this loop into its own method so that we can measure its performance without _calculateClassesRetainedSize. WDYT?
> 
> > Source/WebCore/inspector/front-end/HeapSnapshot.js:1138
> > +            var selfSize = onlyNodes[nodeIndex + selfSizeOffset];
> 
> Given that in other places here we use "node" to get corresponding field value I'd rather use it here as well for consistency. Does it have any impact on the performance of this method?

v8 doesn't inline our getters. I'd like to inline classIndex too but it a separate patch. Also in general we have no control over filter function.

> 
> > Source/WebCore/inspector/front-end/HeapSnapshot.js:1195
> > +            var dominatedIndexFrom = firstDominatedNodeIndex[nodeIndex / nodeFieldCount];
> 
> var nodeOrdinal = nodeIndex / nodeFieldCount; ?

done
Comment 6 Alexei Filippov 2012-04-04 08:33:10 PDT
lgtm
Comment 7 Ilya Tikhonovsky 2012-04-04 08:50:15 PDT
Committed r113194: <http://trac.webkit.org/changeset/113194>