Push vs Splice (v3)

Revision 3 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];

Test runner

Ready to run.

Testing in
TestOps/sec
Splice Add
function spliceAdd() {
  arr.splice(arr.length, 0, 5);
}
ready
Push Add
function spliceAdd() {
  arr.push(5);
}
ready

Revisions

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