Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash.js intersection vs native
(version: 0)
Comparing performance of:
Native vs Lodash.js filter
Created:
4 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.4/lodash.min.js"></script>
Script Preparation code:
var max2 = 1000; var arr1 = []; for (var i = max2 / 2; i <= max2 + max2 / 2; i++) { arr1.push(i); } var arr2 = []; for (var i = 0; i <= max2; i++) { arr2.push(i); }
Tests:
Native
const varMap = arr2.reduce((a, b) => ({...a, [b]: true}), {}); arr2.some(x => varMap[x]);
Lodash.js filter
_.intersection(arr1, arr2).length > 0;
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Native
Lodash.js filter
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!
Related benchmarks:
Lodash.js vs Native isArrary
Lodash.js vs Native Intersection
Lodash.js vs Native Intersection1
Lodash.js wrapper vs js native
Comments
Confirm delete:
Do you really want to delete benchmark?