Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
lodash@4.17.15 uniq vs new Set() (w/ datetime strings)
(version: 0)
Comparing uniq vs new Set using a mid-sized array (length: 239) of datetime strings.
Comparing performance of:
_.uniq vs new Set()
Created:
3 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src='https://cdn.jsdelivr.net/npm/lodash@4.17.15/lodash.min.js'></script>
Script Preparation code:
var datetimes = [ "2023-02-14T17:30", "2023-02-14T17:30", "2023-02-14T17:30", "2023-02-14T17:30", "2023-02-14T17:30", "2023-02-14T17:30", "2023-02-14T17:45", "2023-02-14T17:45", "2023-02-14T17:45", "2023-02-14T17:45", "2023-02-14T17:45", "2023-02-14T17:45", "2023-02-14T18:00", "2023-02-14T18:00", "2023-02-14T18:00", "2023-02-14T18:00", "2023-02-14T18:00", "2023-02-14T18:00", "2023-02-14T18:15", "2023-02-14T18:15", "2023-02-14T18:15", "2023-02-14T18:15", "2023-02-14T18:15", "2023-02-14T18:15", "2023-02-14T18:30", "2023-02-14T18:30", "2023-02-14T18:30", "2023-02-14T18:30", "2023-02-14T18:30", "2023-02-14T18:30", "2023-02-14T18:45", "2023-02-14T18:45", "2023-02-14T18:45", "2023-02-14T18:45", "2023-02-14T18:45", "2023-02-14T18:45", "2023-02-14T19:00", "2023-02-14T19:00", "2023-02-14T19:00", "2023-02-14T19:00", "2023-02-14T19:00", "2023-02-14T19:00", "2023-02-14T19:15", "2023-02-14T19:15", "2023-02-14T19:15", "2023-02-14T19:15", "2023-02-14T19:15", "2023-02-14T19:15", "2023-02-14T19:30", "2023-02-14T19:30", "2023-02-14T19:30", "2023-02-14T19:30", "2023-02-14T19:30", "2023-02-14T19:30", "2023-02-14T19:45", "2023-02-14T19:45", "2023-02-14T19:45", "2023-02-14T19:45", "2023-02-14T19:45", "2023-02-14T19:45", "2023-02-14T20:00", "2023-02-14T20:00", "2023-02-14T20:00", "2023-02-14T20:00", "2023-02-14T20:00", "2023-02-14T20:00", "2023-02-14T20:15", "2023-02-14T20:15", "2023-02-14T20:15", "2023-02-14T20:15", "2023-02-14T20:15", "2023-02-14T20:15", "2023-02-14T20:30", "2023-02-14T20:30", "2023-02-14T20:30", "2023-02-14T20:30", "2023-02-14T20:30", "2023-02-14T20:30", "2023-02-14T20:45", "2023-02-14T20:45", "2023-02-14T20:45", "2023-02-14T20:45", "2023-02-14T20:45", "2023-02-14T20:45", "2023-02-14T21:00", "2023-02-14T21:00", "2023-02-14T21:00", "2023-02-14T21:00", "2023-02-14T21:00", "2023-02-14T21:00", "2023-02-14T21:15", "2023-02-14T21:15", "2023-02-14T21:15", "2023-02-14T21:15", "2023-02-14T21:15", "2023-02-14T21:15", "2023-02-14T21:30", "2023-02-14T21:30", "2023-02-14T21:30", "2023-02-14T21:30", "2023-02-14T21:30", "2023-02-14T21:30", "2023-02-14T21:45", "2023-02-14T21:45", "2023-02-14T21:45", "2023-02-14T21:45", "2023-02-14T21:45", "2023-02-14T21:45", "2023-02-14T14:00", "2023-02-14T19:00", "2023-02-14T17:30", "2023-02-14T17:30", "2023-02-14T17:30", "2023-02-14T17:30", "2023-02-14T17:30", "2023-02-14T17:30", "2023-02-14T17:30", "2023-02-14T17:45", "2023-02-14T17:45", "2023-02-14T17:45", "2023-02-14T17:45", "2023-02-14T17:45", "2023-02-14T17:45", "2023-02-14T17:45", "2023-02-14T18:00", "2023-02-14T18:00", "2023-02-14T18:00", "2023-02-14T18:00", "2023-02-14T18:00", "2023-02-14T18:00", "2023-02-14T18:00", "2023-02-14T18:15", "2023-02-14T18:15", "2023-02-14T18:15", "2023-02-14T18:15", "2023-02-14T18:15", "2023-02-14T18:15", "2023-02-14T18:15", "2023-02-14T18:30", "2023-02-14T18:30", "2023-02-14T18:30", "2023-02-14T18:30", "2023-02-14T18:30", "2023-02-14T18:30", "2023-02-14T18:30", "2023-02-14T18:45", "2023-02-14T18:45", "2023-02-14T18:45", "2023-02-14T18:45", "2023-02-14T18:45", "2023-02-14T18:45", "2023-02-14T18:45", "2023-02-14T19:00", "2023-02-14T19:00", "2023-02-14T19:00", "2023-02-14T19:00", "2023-02-14T19:00", "2023-02-14T19:00", "2023-02-14T19:00", "2023-02-14T19:15", "2023-02-14T19:15", "2023-02-14T19:15", "2023-02-14T19:15", "2023-02-14T19:15", "2023-02-14T19:15", "2023-02-14T19:15", "2023-02-14T19:30", "2023-02-14T19:30", "2023-02-14T19:30", "2023-02-14T19:30", "2023-02-14T19:30", "2023-02-14T19:30", "2023-02-14T19:30", "2023-02-14T19:45", "2023-02-14T19:45", "2023-02-14T19:45", "2023-02-14T19:45", "2023-02-14T19:45", "2023-02-14T19:45", "2023-02-14T19:45", "2023-02-14T20:00", "2023-02-14T20:00", "2023-02-14T20:00", "2023-02-14T20:00", "2023-02-14T20:00", "2023-02-14T20:00", "2023-02-14T20:00", "2023-02-14T20:00", "2023-02-14T20:00", "2023-02-14T20:00", "2023-02-14T20:15", "2023-02-14T20:15", "2023-02-14T20:15", "2023-02-14T20:15", "2023-02-14T20:15", "2023-02-14T20:15", "2023-02-14T20:15", "2023-02-14T20:30", "2023-02-14T20:30", "2023-02-14T20:30", "2023-02-14T20:30", "2023-02-14T20:30", "2023-02-14T20:30", "2023-02-14T20:30", "2023-02-14T20:45", "2023-02-14T20:45", "2023-02-14T20:45", "2023-02-14T20:45", "2023-02-14T20:45", "2023-02-14T20:45", "2023-02-14T20:45", "2023-02-14T21:00", "2023-02-14T21:00", "2023-02-14T21:00", "2023-02-14T21:00", "2023-02-14T21:00", "2023-02-14T21:00", "2023-02-14T21:00", "2023-02-14T21:15", "2023-02-14T21:15", "2023-02-14T21:15", "2023-02-14T21:15", "2023-02-14T21:15", "2023-02-14T21:15", "2023-02-14T21:15", "2023-02-14T21:30", "2023-02-14T21:30", "2023-02-14T21:30", "2023-02-14T21:30", "2023-02-14T21:30", "2023-02-14T21:30", "2023-02-14T21:30", "2023-02-14T21:45", "2023-02-14T21:45", "2023-02-14T21:45", "2023-02-14T21:45", "2023-02-14T21:45", "2023-02-14T21:45", "2023-02-14T21:45" ];
Tests:
_.uniq
return _.uniq(datetimes);
new Set()
return new Set(datetimes);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
_.uniq
new Set()
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!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
Let's dive into the benchmark results. **Benchmarking Results** We have two test cases: `new Set()` and `_.uniq`. 1. **New Set()** * Raw UA String: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36 * Browser: Chrome 109 * Device Platform: Desktop * Operating System: Mac OS X 10.15.7 * Executions Per Second: 361719.65625 2. **_.uniq** * Raw UA String: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36 * Browser: Chrome 109 * Device Platform: Desktop * Operating System: Mac OS X 10.15.7 * Executions Per Second: 339114.65625 **Comparison** The `new Set()` method outperforms the `_` library's `uniq` function by a significant margin, with an execution speed of approximately 6.8 times faster. **Conclusion** Based on these benchmark results, it appears that using the native `Set` data structure in JavaScript is more efficient than relying on a third-party library like Lodash for performing unique value sets.
Related benchmarks:
_.sortBy vs native sort
simple stuff
simple stuffddd
ISO 8601 parsing
Comments
Confirm delete:
Do you really want to delete benchmark?