Bug 86732 - Web Inspector: speed-up markQueriableHeapObjects function.
Summary: Web Inspector: speed-up markQueriableHeapObjects function.
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: 87089
  Show dependency treegraph
 
Reported: 2012-05-17 07:47 PDT by Ilya Tikhonovsky
Modified: 2012-05-22 00:01 PDT (History)
10 users (show)

See Also:


Attachments
Patch (4.73 KB, patch)
2012-05-17 07:49 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-05-17 07:47:38 PDT
inline getters

RESULT heap-snapshot: _markQueriableHeapObjects= 879 ms
vs
RESULT heap-snapshot: _markQueriableHeapObjects= 42 ms
Comment 1 Ilya Tikhonovsky 2012-05-17 07:49:16 PDT
Created attachment 142474 [details]
Patch
Comment 2 Yury Semikhatsky 2012-05-17 07:57:29 PDT
Comment on attachment 142474 [details]
Patch

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

> Source/WebCore/inspector/front-end/HeapSnapshot.js:-1180
> -                list.push(iter.edge.node.nodeIndex);

Please revert this part.

> Source/WebCore/inspector/front-end/HeapSnapshot.js:1197
> +                         ? nodes[nodeIndex + firstEdgeIndexOffset + nodeFieldCount]

Please realign these two lines.

> Source/WebCore/inspector/front-end/HeapSnapshot.js:1213
> +        this._flags = new Uint32Array(this.nodeCount);

Does it make any difference?
Comment 3 Ilya Tikhonovsky 2012-05-17 22:43:57 PDT
Committed r117545: <http://trac.webkit.org/changeset/117545>
Comment 4 Ilya Tikhonovsky 2012-05-17 22:58:40 PDT
(In reply to comment #2)
> (From update of attachment 142474 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=142474&action=review
> 
> > Source/WebCore/inspector/front-end/HeapSnapshot.js:-1180
> > -                list.push(iter.edge.node.nodeIndex);
> 
> Please revert this part.

done

> 
> > Source/WebCore/inspector/front-end/HeapSnapshot.js:1197
> > +                         ? nodes[nodeIndex + firstEdgeIndexOffset + nodeFieldCount]
> 
> Please realign these two lines.

done

> 
> > Source/WebCore/inspector/front-end/HeapSnapshot.js:1213
> > +        this._flags = new Uint32Array(this.nodeCount);
> 
> Does it make any difference?

This line is the root for the sake of which all the patch has been made.
Before the patch the array was sparse. Actually it was a hash map.
Now we have no memory overhead and we can make it external.
It gives us an additional speed boost and reduces js heap footprint.