On 07/16/2014 11:08 PM, Nicholas Nethercote wrote:
So then I tried reverting that change and inserting this line just
before the loop:
array[length - 1] = 0;
And now it avoids the doubling allocations -- the array elements are
allocated once, at the right size. But it feels dirty, and I don't
know if would give the same behaviour in other JS engines.
Arrays implementation are really different between JavaScript engines.
I know that is used to make us produce a spare array where in addition to
setting the last element, we pay the cost for each assignment done in the
middle after.
--
Nicolas B. Pierron
_______________________________________________
dev-tech-js-engine-internals mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals