Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
intersection lodash
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36
Browser:
Chrome 139
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
8 months ago
Test name
Executions per second
set
11741373.0 Ops/sec
lodash
6096162.5 Ops/sec
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.4/lodash.min.js"></script>
Script Preparation code:
var arr1 = ['sections-a', 'sections-b', 'sections-c', 'sections-d', 'sections-e', 'sections-f']; var arr2 = ['sections-a', 'sections-b', 'sections-b', 'sections-b', 'sections-b', 'sections-b'];
Tests:
set
const arrSet = new Set(arr1) const filtered = arr2.filter( value => arrSet.has(value))
lodash
_.intersection(arr1, arr2)