Status: New
Owner: ----

New issue 2076 by [email protected]: A performance bug of inline caching of DOM attribute setters
http://code.google.com/p/v8/issues/detail?id=2076

Currently a DOM attribute is defined on a DOM object, but the spec requires that a DOM attribute should be defined on the prototype chain.

Regarding DOM attribute getters, even if we move the DOM attribute to the prototype chain, it does not cause any overhead. Here, the "overhead" means the V8 overhead to call back the V8 binding code. Consider the following two V8 bindings:

static v8::Handle<v8::Value> onDOMObjectAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) // A DOM attribute defined on a DOM object
    {
        /* Do nothing */
        return v8::Handle<v8::Value>();
    }

static v8::Handle<v8::Value> onPrototypeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) // A DOM attribute defined on a prototype object
    {
        /* Do nothing */
        return v8::Handle<v8::Value>();
    }

I measured the overhead by the performance difference between 'div.onDOMObject' and 'div.onPrototype'.

On the other hand, regarding DOM attribute setters, if we move the DOM attribute to the prototype chain, it causes 120 ~ 160 ns of overhead. This is considered to be a performance bug of inline caching of DOM attribute setters.

For more details (viewable from google internal only): https://docs.google.com/a/google.com/document/d/1ldrDdfcwij5_juqvRpI_Rq20SgWiR88c4DUFvkQ0olU/edit


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to