copy array slice-vs-concat (v5)

Revision 5 of this benchmark created on


Preparation HTML

<script>
  var a = [];

  for (var i = 0; i < 10000; i++)
    a.push('550e8400-e29b-41d4-a716-446655440000');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
concat
var b = a.concat();
ready
json
var b = JSON.parse(JSON.stringify(a));
ready
slice
var b = a.slice(0);
ready
concat new
var b = [].concat(a);
ready

Revisions

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