Typped array copy clone (v37)

Revision 37 of this benchmark created on


Setup

var data = new Int32Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 0])

Test runner

Ready to run.

Testing in
TestOps/sec
loop copy
var copy = new Int32Array(11);
for (var j = 0; j < data.length; j++) {
  copy[j] = data[j];
}
ready
splice copy
var copy = new Int32Array(11);
var copy = data.slice(0);
ready
.set Test
var copy = new Int32Array(11);
copy.set(data);
ready

Revisions

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