Bug 96039 - [V8] Weave creationContext through toV8 and related functions
Summary: [V8] Weave creationContext through toV8 and related functions
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adam Barth
URL:
Keywords:
Depends on:
Blocks: 96038
  Show dependency treegraph
 
Reported: 2012-09-06 16:39 PDT by Adam Barth
Modified: 2012-09-07 19:50 PDT (History)
7 users (show)

See Also:


Attachments
Patch (132.02 KB, patch)
2012-09-06 16:41 PDT, Adam Barth
eric: review+
abarth: commit-queue-
Details | Formatted Diff | Diff
run-bindings-tests diffs (60.91 KB, patch)
2012-09-06 16:43 PDT, Adam Barth
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Barth 2012-09-06 16:39:54 PDT
[V8] Weave creationContext through toV8 and related functions
Comment 1 Adam Barth 2012-09-06 16:41:41 PDT
Created attachment 162618 [details]
Patch
Comment 2 Adam Barth 2012-09-06 16:43:35 PDT
Created attachment 162619 [details]
run-bindings-tests diffs
Comment 3 Adam Barth 2012-09-06 16:44:15 PDT
I put the run-bindings-tests diffs in a separate patch file to make it easier to read.
Comment 4 Kentaro Hara 2012-09-06 16:57:51 PDT
Comment on attachment 162618 [details]
Patch

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

> Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:508
> +inline v8::Handle<v8::Value> toV8(${nativeType}* impl, v8::Handle<v8::Context> creationContext = v8::Handle<v8::Context>(), v8::Isolate* isolate = 0${forceNewObjectParameter})

Isn't there any perf concern about creating v8::Handle<v8::Context>() every time? toV8() should be super fast especially for node wrapper objects. If you cannot observe any perf regression in Binding/first-child, then it looks OK.
Comment 5 Adam Barth 2012-09-06 17:19:23 PDT
> Isn't there any perf concern about creating v8::Handle<v8::Context>() every time? toV8() should be super fast especially for node wrapper objects. If you cannot observe any perf regression in Binding/first-child, then it looks OK.

I'll check before landing.  At the moment, I'm just trying to get it working.
Comment 6 Adam Barth 2012-09-06 17:36:14 PDT
Looks like I might have made it marginally faster.  The "before" numbers are before this patch and the "after" numbers are after this patch and the patch in Bug 96044.

== Before ==

Running 1 tests
Running Bindings/first-child.html (1 of 1)
DESCRIPTION: This benchmark covers 'firstChild', 'lastChild', 'nextSibling' and 'previousSibling' in Dromaeo/dom-traverse.html, and other DOM attributes that return a Node object.
RESULT Bindings: first-child= 812.341722521 runs/s
median= 812.182741117 runs/s, stdev= 1.8782032458 runs/s, min= 807.061790668 runs/s, max= 815.286624204 runs/s
RESULT Bindings: first-child: JSHeap= 1330116.8 bytes
median= 1326596.0 bytes, stdev= 12326.5484934 bytes, min= 1319888.0 bytes, max= 1367520.0 bytes
RESULT Bindings: first-child: Malloc= 0.0 bytes
median= 0.0 bytes, stdev= 0.0 bytes, min= 0.0 bytes, max= 0.0 bytes

== After ==

DESCRIPTION: This benchmark covers 'firstChild', 'lastChild', 'nextSibling' and 'previousSibling' in Dromaeo/dom-traverse.html, and other DOM attributes that return a Node object.
RESULT Bindings: first-child= 813.735729057 runs/s
median= 814.249363868 runs/s, stdev= 1.80420562007 runs/s, min= 810.126582278 runs/s, max= 816.326530612 runs/s
RESULT Bindings: first-child: JSHeap= 1330162.4 bytes
median= 1326696.0 bytes, stdev= 12300.6580897 bytes, min= 1319976.0 bytes, max= 1367520.0 bytes
RESULT Bindings: first-child: Malloc= 0.0 bytes
median= 0.0 bytes, stdev= 0.0 bytes, min= 0.0 bytes, max= 0.0 bytes
Comment 7 Kentaro Hara 2012-09-06 17:37:57 PDT
(In reply to comment #6)
> Looks like I might have made it marginally faster.  The "before" numbers are before this patch and the "after" numbers are after this patch and the patch in Bug 96044.

Looks good:)
Comment 8 Csaba Osztrogonác 2012-09-06 23:15:24 PDT
https://trac.webkit.org/changeset/127806 broke bindings tests on the bots.
Could you check it, please?
Comment 9 Tim Horton 2012-09-07 01:02:50 PDT
(In reply to comment #8)
> https://trac.webkit.org/changeset/127806 broke bindings tests on the bots.
> Could you check it, please?

Oddly, this bug is still in NEW. And, it looks like the second patch (rebaselining the bindings test) didn't get landed.
Comment 10 Adam Barth 2012-09-07 10:23:04 PDT
(In reply to comment #8)
> https://trac.webkit.org/changeset/127806 broke bindings tests on the bots.
> Could you check it, please?

Oh, sorry.  I forgot that I put the bindings results in a separate patch.
Comment 11 Adam Barth 2012-09-07 10:25:39 PDT
https://bugs.webkit.org/show_bug.cgi?id=96039
Comment 12 Adam Barth 2012-09-07 19:50:21 PDT
> Isn't there any perf concern about creating v8::Handle<v8::Context>() every time? toV8() should be super fast especially for node wrapper objects. If you cannot observe any perf regression in Binding/first-child, then it looks OK.

Turns out you were right, but the issue was with calling CreationContext().  Binding/first-child didn't see the problem initially because that particular code path wasn't using CreationContext() in this patch.

http://trac.webkit.org/changeset/127946 delays delays calling CreationContext() until we actually need it, which seems to solve the problem.  http://trac.webkit.org/changeset/127955 then causes Binding/first-child to go through this new code path and doesn't show a perf regression.