Re: Why is querySelector much slower?

On 4/29/15 12:23 AM, Glen Huang wrote:
>> because of the proxy machinery involved on the JS engine side
>
> Do you mean the cost introduced by passing a C++ object into ecmascript world?

No, it's the cost introduced by needing custom property behavior for 
integer-named properties on lists (and in particular the need to have 
them appear and disappear, not be redefinable, and so forth).  The 
upshot in the SpiderMonkey implementation is that the list object is a 
proxy in the ES6 sense, which makes the [0] access take a slower path 
through the JS engine than I'd like.

-Boris

Received on Wednesday, 29 April 2015 13:12:22 UTC