Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
lodash uniq vs native uniq with long array
(version: 1)
Comparing performance of:
native uniq vs ld uniq
Created:
11 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
var obj = [1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1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, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,1, 2, 3, 4, 6, 6, 4, 1, 2, 2, 3,];
Tests:
native uniq
let u = new Set(obj);
ld uniq
let u = _.uniq(obj);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
native uniq
ld uniq
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
11 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Browser/OS:
Chrome 136 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
native uniq
185526.8 Ops/sec
ld uniq
184682.8 Ops/sec
Related benchmarks:
using .length within and out of for loop
Lodash filter length vs sumby
union vs concat+uniq
unique elements in array using filter v2
unique elements in array using filter v2.3
unique elements in array using filter - large array
set.has vs. array.includes bigger sample
set.has vs. array.includes (with big array)
JS fastest unique array Set vs uniq vs filter
Comments
Confirm delete:
Do you really want to delete benchmark?