Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
lodash shuffle vs js native
const shuffleColor = (array) => { const length = array === null ? 0 : array.length; return length ? array[Math.floor(Math.random() * length)] : undefined; };
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0
Browser:
Firefox 132
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
lodash shuffle
8888132.0 Ops/sec
js native shuffle
1355291008.0 Ops/sec
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
const colors = [ 'from-indigo-500', 'from-yellow-500', 'from-purple-500', 'from-red-500', 'from-green-500', 'from-blue-500', 'from-pink-500', ];
Tests:
lodash shuffle
const colors = [ 'from-indigo-500', 'from-yellow-500', 'from-purple-500', 'from-red-500', 'from-green-500', 'from-blue-500', 'from-pink-500', ]; _.shuffle(colors)
js native shuffle
const colors = [ 'from-indigo-500', 'from-yellow-500', 'from-purple-500', 'from-red-500', 'from-green-500', 'from-blue-500', 'from-pink-500', ]; const shuffleColor = (array) => { const length = array === null ? 0 : array.length; return length ? array[Math.floor(Math.random() * length)] : undefined; };