Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
lodash uniq vs Array.from(new Set()) vs spread new Set() [big arrays]
(version: 0)
Comparing performance of:
Spread vs use lodash vs Array.from
Created:
2 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src='https://cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js'></script>
Script Preparation code:
var arr = new Array(10_000).fill(1).map(() => Math.round(Math.random() * 100))
Tests:
Spread
return [...new Set(arr)]
use lodash
return _.uniq(arr);
Array.from
return Array.from( new Set(arr) );
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Spread
use lodash
Array.from
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?