for find

Benchmark created on


Setup

const a = new Array(1e3).fill(1).map((_,i)=>i)
const b = new Array(1e4).fill(1).map((_,i)=>i)

Test runner

Ready to run.

Testing in
TestOps/sec
.find 1k
a.find(x => false)
ready
for 1k
for (let i = 0; i < a.length; i++) {
	if (a[i] === -1) {
		break
	}
}
ready
.find 10k
b.find(x => false)
ready
for 10k
for (let i = 0; i < a.length; i++) {
	if (a[i] === -1) {
		break
	}
}
ready

Revisions

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