min

Benchmark created on


Setup

const size = 100
const data = Array(size).fill().map(() => Math.random())

Test runner

Ready to run.

Testing in
TestOps/sec
Math.min
Math.min(...data)
ready
sort
data.sort((a, b)=> a-b)[0]
ready
reduce
data.reduce((acc, a) => Math.min(acc, a), Infinity)
ready
for of
let min = Infinity
for (const a of data){
	min = Math.min(min, a)
}
ready

Revisions

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