IntArray16 vs Array; populate & sort

Benchmark created on


Setup

const randomArray = [];

for(let i = 0; i < 500000; i++)
{
	randomArray[i] = Math.round(Math.random() * 100000);
}

Test runner

Ready to run.

Testing in
TestOps/sec
array
const arr = new Array(500000);

for(let i = 0; i < 500000; i++)
{
	arr[i] = randomArray[i];
}

arr.sort((a, b) => a - b);
ready
IntArray
const int32arr = new Int32Array(500000);

for(let i = 0; i < 500000; i++)
{
	int32arr[i] = randomArray[i];
}

int32arr.sort();
ready

Revisions

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