Re: How to correctly spec sequences requiring an iterable

On 11/18/13 3:11 PM, Jonas Sicking wrote:
> One thing that very well might be worth optimizing is when a function
> is passed a "plain" Array as the iterable.

Right, that's the only case really worth optimizing.

> We'd of course have to detect that no custom iterator

"fragile and non-trivial".  ;)

> or custom numeric getters

We don't check for that now, we just blindly get using the slow path 
that would handle them, fwiw.  In practice nothing is gated on the 
performance of this bit that I've seen.

> I would expect that this is an optimization that the JS engine is
> interested in doing internally too, for things like Array.concat etc.

It is and they do.  It's a pretty subtle optimization, though, and easy 
to get wrong.  Even easier to become wrong later.


Received on Monday, 18 November 2013 20:24:26 UTC