Push vs Splice (v6)

Revision 6 of this benchmark created on


Setup

var arr = [1,4,2,1,23,3,2,32,3,23,2,3,12,3,123,123,32,3,423,423,4,234,23,42,23,4,4,23,423,4,2,423,42,4,234];
    
    function spliceAdd() {
      arr.splice(arr.length, 0, arr.length);
    }
    
    function pushAdd() {
      arr.push(5);
    }

Test runner

Ready to run.

Testing in
TestOps/sec
Splice Add
spliceAdd();
ready
Push Add
pushAdd();
ready

Revisions

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