On Thu, Oct 30, 2014 at 6:44 PM, Steve Fink <[email protected]> wrote:
> Now there is %TypedArray%.prototype.fill. But I've become generally
> skeptical about it as an answer to performance concerns. I would rather
> see engines hyperoptimize
>
> for(var i=0; i<size; i++){ someArray[i] = 0; }
>
> based on observed type information. Which is not to say that we wouldn't
> want to make TA#fill fast too, but the above seems more generally useful.
>
While useful, it's not a substitute for a convenient and fast method. Also,
I presented severe usuability issues with that approach if you need more
than one value (such as computed values). Usability issues which can be
resolved by using set + a new list for every assignment, which,
unfortunately, is also quite slow. It's slow because say, for a loop that's
running a million times, it makes a million lists.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss