Bug 96039

Summary: [V8] Weave creationContext through toV8 and related functions
Product: WebKit Reporter: Adam Barth <abarth>
Component: New BugsAssignee: Adam Barth <abarth>
Status: RESOLVED FIXED    
Severity: Normal CC: eric, haraken, japhet, mitz, ossy, thorton, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 96038    
Attachments:
Description Flags
Patch
eric: review+, abarth: commit-queue-
run-bindings-tests diffs none

Adam Barth
Reported 2012-09-06 16:39:54 PDT
[V8] Weave creationContext through toV8 and related functions
Attachments
Patch (132.02 KB, patch)
2012-09-06 16:41 PDT, Adam Barth
eric: review+
abarth: commit-queue-
run-bindings-tests diffs (60.91 KB, patch)
2012-09-06 16:43 PDT, Adam Barth
no flags
Adam Barth
Comment 1 2012-09-06 16:41:41 PDT
Adam Barth
Comment 2 2012-09-06 16:43:35 PDT
Created attachment 162619 [details] run-bindings-tests diffs
Adam Barth
Comment 3 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.
Kentaro Hara
Comment 4 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.
Adam Barth
Comment 5 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.
Adam Barth
Comment 6 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
Kentaro Hara
Comment 7 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:)
Csaba Osztrogonác
Comment 8 2012-09-06 23:15:24 PDT
https://trac.webkit.org/changeset/127806 broke bindings tests on the bots. Could you check it, please?
Tim Horton
Comment 9 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.
Adam Barth
Comment 10 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.
Adam Barth
Comment 11 2012-09-07 10:25:39 PDT
Adam Barth
Comment 12 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.
Note You need to log in before you can comment on or make changes to this bug.