Concat vs Splice (v10)

Revision 10 of this benchmark created on


Description

Compare single large concat to splice

Setup

a = [];
    b = [];
    
    for(var i = 0; i < 1000; i++) {
      a.push(i);
      b.push(i);
    }

Test runner

Ready to run.

Testing in
TestOps/sec
Concat
a = a.concat(b);
ready
Splice
Array.prototype.splice.apply(a, [0, 0].concat(b));
 
ready

Revisions

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