Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array Shuffling
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser:
Chrome 130
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
sort randomly
890946.4 Ops/sec
shuffle func
6310529.0 Ops/sec
Script Preparation code:
var array = ['kruze', 'medspoke', 'pickfood','listNride', 'herokey'] function shuffleArray (array) { for (let i = array.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)) const temp = array[i] array[i] = array[j] array[j] = temp } return array }
Tests:
sort randomly
array.sort(() => Math.random() - Math.random())
shuffle func
shuffleArray(array);