testing multitype array

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
multi type
let bubbles = [];
for(let i = 0; i < 10_000; i++){
	bubbles.push([Math.random(), Math.random() > 0])
}
let newBubbles = [];
for(let i = 0; i < bubbles.length; i++){
	if(Math.random() > 0.5){
		newBubbles.push(bubbles[i]);
	}
}
ready
single type
let bubbles1 = [];
let bubbles2 = []
for(let i = 0; i < 10_000; i++){
	bubbles1.push(Math.random())
	bubbles2.push(Math.random() > 0)
}
let newBubbles1 = [];
let newBubbles2 = [];
for(let i = 0; i < bubbles1.length; i++){
	if(Math.random() > 0.5){
		newBubbles1.push(bubbles1[i]);
		newBubbles2.push(bubbles2[i]);
	}
}
ready

Revisions

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