Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
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
Benchmark engine:
Benchmark.js
shuffle func
6.3M/s
sort randomly
891K/s
View exact numbers
Test name
Executions per second
✓
shuffle func
6,310,529 Ops/sec
sort randomly
890,946 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);