splice to end vs. assigned concat

Benchmark created by humanchimp on


Preparation HTML

<script>
  var foo = [1,2,3]
  var bar = [1,2,3]
  var baz = [1,2,3]
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
splice to end
foo.splice.apply(foo, [foo.length, 0].concat([4,5,6]))
ready
assign concat
bar = bar.concat([4,5,6])
ready
push
baz.push.apply(bar, [4,5,6])
ready

Revisions

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

  • Revision 1: published by humanchimp on