Array copy (v3)

Revision 3 of this benchmark created on


Description

Cloning arrays

Setup

var acc = 0;
var W = 100;
var size = W * W;
var typed = new Int32Array(size);
crypto.getRandomValues(typed);

Test runner

Ready to run.

Testing in
TestOps/sec
TypedArray
const array = typed.slice();
for (let x = 0; x < size; x++) {
  acc += array[x];
}
ready
array[]
const array = [...typed];
for (let x = 0; x < size; x++) {
  acc += array[x];
}
ready

Revisions

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