Comment #3 on issue 2245 by [email protected]: Handle<Value>() is slower
than Undefined(info.GetIsolate())
http://code.google.com/p/v8/issues/detail?id=2245
Thank you very much!
I am building in the Release mode.
How to reproduce: (I am sorry, the step is complicated. Please try it when
you have time:-)
(1) Add the following three lines to
src/third_party/WebKit/Source/WebCore/html/HTMLDivElement.idl (just
after 'align' attribute)
readonly attribute int testAttr1;
readonly attribute int testAttr2;
readonly attribute int testAttr3;
(2) Build chrome in the Release mode. The build will fail.
(3) Open src/out/Release/obj/gen/webcore/bindings/V8HTMLDivElement.cpp.
Remove the method contents of testAttr1AttrGetter(), testAttr2AttrGetter()
and testAttr3AttrGetter(). Instead, please write the following methods:
static v8::Handle<v8::Value> testAttr1AttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) {
return v8::Handle<v8::Value>();
}
static v8::Handle<v8::Value> testAttr2AttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) {
return v8::Undefined();
}
static v8::Handle<v8::Value> testAttr3AttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) {
return v8::Undefined(info.GetIsolate());
}
(4) Build Chrome again in the Release mode. This build should succeed.
(5) Open http://www.corp.google.com/~haraken/null/v8undefined.html In my
Linux desktop, I can get the following results:
testAttr1 : mean=91.20ms, min=89ms, median=90ms, max=96ms
testAttr2 : mean=81.60ms, min=81ms, median=82ms, max=82ms
testAttr3 : mean=142.20ms, min=142ms, median=142ms, max=143ms
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev