arrays

JavaScript performance comparison

Test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var big = new Array(10000)
    var small = new Array(1000)
    for(var i = 0;i!=small.length;i++){small[i]=i;};
    for(var i = 0;i!=big.length;i++){big[i]=i;};
};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
small.concat
small.concat(big);
pending…
big.concat
big.concat(small);
pending…
push to small
big.forEach(function(x){small.push(x)})
pending…
push to big
small.forEach(function(x){big.push(x)})
pending…
unshift to small
big.forEach(function(x){small.unshift(x)})
pending…
unshift to big
small.forEach(function(x){big.unshift(x)})
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

2 comments

Wilgeforz commented :

Нихрена не верно.

Wilgeforz commented :

Хотя нет я ошибся.

Add a comment