Status: New
Owner: ----
New issue 903 by jmar777: Array Concat with Non-Array Param Performance
Issue
http://code.google.com/p/v8/issues/detail?id=903
When performing a Array.prototype.concat with a non-array value parameter,
there seems to be a severe performance degradation when compared to using
an array value arameter.
For example, when running the following test case...
var a = [1], b = [2], start = new Date(), i = 0;
for (; i < 1000000; i++) { a.concat(b); }
console.log(new Date() - start);
... I receive an average time of 68ms using node.js (v0.2.2) as a
container, and an average of 883ms using Chrome (v7.0.517.41 beta) as a
container.
If I run the same test case, but assign a numeric value to b, rather than
an array...
var a = [1], b = 2, start = new Date(), i = 0;
for (; i < 1000000; i++) { a.concat(b); }
console.log(new Date() - start);
... I receive an average time of 1536ms in node.js, and 2742ms in Chrome.
I'm running Mac OS X (10.6.4) on a 2.66 GHz Intel Core i7 processor with
8GB of 1067 MHz DDR3 memory.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev