Push vs Splice

Benchmark created by Bill on


Setup

var arr = [];

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.