Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Lodash _.union vs native Set()
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0
Browser:
Firefox 126
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
_.union
3.7M/s
Set()
2.9M/s
Set() convert back to array
1.9M/s
View exact numbers
Test name
Executions per second
✓
_.union
3,651,011 Ops/sec
Set()
2,891,686 Ops/sec
Set() convert back to array
1,918,226 Ops/sec
HTML Preparation code:
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js"></script>
Script Preparation code:
var a = [1, 2, 3, 4, 5] var b = [3, 4, 5, 6, 7]
Tests:
_.union
var c = _.union(a, b)
Set()
var c = new Set(a, b)
Set() convert back to array
var c = new Set(a, b) var d = Array.from(c)