[webkit-dev] Making more use of ScriptWrappable

Ryosuke Niwa rniwa at webkit.org
Thu Nov 1 11:35:58 PDT 2012

On Thu, Nov 1, 2012 at 11:04 AM, Adam Barth <abarth at webkit.org> wrote:
> On Thu, Nov 1, 2012 at 10:51 AM, Alexey Proskuryakov <ap at apple.com> wrote:
>> 01.11.2012, в 10:36, Adam Barth <abarth at webkit.org> написал(а):
>>> Today, we use ScriptWrappable for Nodes only, but we would benefit by
>>> making more use of ScriptWrappable, particularly for DOM objects that
>>> almost always have JavaScript wrappers.  For example, XMLHttpRequest
>>> objects exist only when created by script, which means that every
>>> XMLHttpRequest object has a JavaScript wrapper.
>> This looks like a great idea for investigation to me.
>> Do you have a rough estimate of how large of a win we are talking about?
> I don't have numbers currently, but I'm happy to gather some.  My
> recollection is that the win for nodes was substantial on DOM
> benchmarks.  I would expect the win to be fairly large for DOM objects
> like NodeList where script is likely to access properties like length
> and item frequently (e.g., in a loop).

Definitely. The last I checked, we spent 3-5% just looking for the
wrapper in the hash map when iterating over NodeList items.

- Ryosuke

More information about the webkit-dev mailing list