Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
join vs every
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Browser:
Chrome 126
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
join
3131998.2 Ops/sec
every
5341621.0 Ops/sec
Tests:
join
const quickSort = (arr) => { if (arr.length <= 1) { return arr } const pivot = arr[0] const left = [] const right = [] for (let i=1; i<arr.length; i++) { if (arr[i] < pivot) { left.push(arr[i]) } else { right.push(arr[i]) } } return [...quickSort(left), pivot, ...quickSort(right)] } const isPermutation = (a, b) => { if (a === b) { return true } if (a.length !== b.length) { return false } const sortedA = quickSort(a) const sortedB = quickSort(b) return sortedA.join('') === sortedB.join('') } isPermutation('abc', 'bac')
every
const quickSort = (arr) => { if (arr.length <= 1) { return arr } const pivot = arr[0] const left = [] const right = [] for (let i=1; i<arr.length; i++) { if (arr[i] < pivot) { left.push(arr[i]) } else { right.push(arr[i]) } } return [...quickSort(left), pivot, ...quickSort(right)] } const isPermutation = (a, b) => { if (a === b) { return true } if (a.length !== b.length) { return false } const sortedA = quickSort(a) const sortedB = quickSort(b) return sortedA.every((x, i) => x === sortedB[i]) } isPermutation('abc', 'bac')