slice vs splice (v8)

Revision 8 of this benchmark created on


Preparation HTML

<script>
  var a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
  var b = [];
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Slice
b = a.slice(5);
ready
Splice
a.splice(0, 5);
b = a;
ready

Revisions

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