Bug 88324

Summary: Web Inspector: serialize edge counts instead of indexes in heap snapshot
Product: WebKit Reporter: Alexei Filippov <alph>
Component: Web Inspector (Deprecated)Assignee: Alexei Filippov <alph>
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   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Alexei Filippov 2012-06-05 05:05:12 PDT
That reduces the snapshot size and thus the transfer time is reduced by ~100ms or 8%.

Before:
RESULT heap-snapshot: transfer-snapshot= 1494 ms
RESULT heap-snapshot: full-summary-snapshot-time= 5827 ms

After:
RESULT heap-snapshot: transfer-snapshot= 1378 ms
RESULT heap-snapshot: _buildEdgeIndexes= 5 ms
RESULT heap-snapshot: full-summary-snapshot-time= 5587 ms
Comment 1 Alexei Filippov 2012-06-05 05:09:30 PDT
Created attachment 145762 [details]
Patch
Comment 2 Ilya Tikhonovsky 2012-06-05 07:28:56 PDT
Comment on attachment 145762 [details]
Patch

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

other

> Source/WebCore/ChangeLog:4
> +        Web Inspector: serialize edge counts instead of indexes in heap snapshot
> +        https://bugs.webkit.org/show_bug.cgi?id=88324

please write more detailed description for the patch

> Source/WebCore/inspector/front-end/HeapSnapshot.js:720
> +            for (var nodeOrdinal = 0; nodeOrdinal < nodeCount; ++nodeOrdinal) {
> +                firstEdgeIndexes[nodeOrdinal] = nodes[nodeOrdinal * nodeFieldCount + nodeEdgesIndexOffset];

it'd be simpler to use nodeFirstEdgeIndex instead of nodeOrdinal here.

> Source/WebCore/inspector/front-end/HeapSnapshot.js:734
> +            edgeIndex += nodes[nodeOrdinal * nodeFieldCount + nodeEdgeCountOffset] * edgeFieldCount;

ditto
Comment 3 Alexei Filippov 2012-06-05 08:03:41 PDT
Comment on attachment 145762 [details]
Patch

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

>> Source/WebCore/ChangeLog:4
>> +        https://bugs.webkit.org/show_bug.cgi?id=88324
> 
> please write more detailed description for the patch

ok

>> Source/WebCore/inspector/front-end/HeapSnapshot.js:720
>> +                firstEdgeIndexes[nodeOrdinal] = nodes[nodeOrdinal * nodeFieldCount + nodeEdgesIndexOffset];
> 
> it'd be simpler to use nodeFirstEdgeIndex instead of nodeOrdinal here.

I need to iterate with nodeOrdinal anyway (it is used in lhs).
So I can't get rid of it and I don't see a point of introducing second index for iteration.

>> Source/WebCore/inspector/front-end/HeapSnapshot.js:734
>> +            edgeIndex += nodes[nodeOrdinal * nodeFieldCount + nodeEdgeCountOffset] * edgeFieldCount;
> 
> ditto

ditto
Comment 4 Alexei Filippov 2012-06-05 08:04:43 PDT
Created attachment 145799 [details]
Patch
Comment 5 Ilya Tikhonovsky 2012-06-05 09:01:24 PDT
Comment on attachment 145799 [details]
Patch

lgtm
Comment 6 Ilya Tikhonovsky 2012-06-05 09:14:03 PDT
Comment on attachment 145799 [details]
Patch

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

> Source/WebCore/inspector/front-end/HeapSnapshot.js:216
> -        this.edge.edgeIndex += this.edge._snapshot._edgeFieldsCount;
> +        this.edge.edgeIndex += this.edge._snapshot._edgeFieldCount;

could you please extract this part of the change as a separate patch
Comment 7 Alexei Filippov 2012-06-05 09:27:01 PDT
Created attachment 145819 [details]
Patch
Comment 8 Alexei Filippov 2012-06-05 09:28:32 PDT
Comment on attachment 145799 [details]
Patch

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

>> Source/WebCore/inspector/front-end/HeapSnapshot.js:216
>> +        this.edge.edgeIndex += this.edge._snapshot._edgeFieldCount;
> 
> could you please extract this part of the change as a separate patch

done
Comment 9 Ilya Tikhonovsky 2012-06-05 10:08:33 PDT
Comment on attachment 145819 [details]
Patch

Clearing flags on attachment: 145819

Committed r119498: <http://trac.webkit.org/changeset/119498>
Comment 10 Ilya Tikhonovsky 2012-06-05 10:08:47 PDT
All reviewed patches have been landed.  Closing bug.