TypedArray copy

Benchmark created on


Setup

const size = 512 * 512 * 2
const original = new Uint8Array(size)

Test runner

Ready to run.

Testing in
TestOps/sec
new TypedArray
const arr = new Uint8Array(original)
ready
Set
const arr2 = new Uint8Array(size)
arr2.set(original)
ready
for loop
const arr3 = new Uint8Array(size)
for(let i = 0; i < size; i++) {
	arr3[i] = original[i]
}
ready

Revisions

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