Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Lodash intersection vs filter find2
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0
Browser:
Firefox 130
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
lodash intersection
2137771.5 Ops/sec
filter find
11536779.0 Ops/sec
filter findIndex
9988432.0 Ops/sec
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
arr1 = [1, 2, 3] arr2 = [{id: 1}, {id: 4}]
Tests:
lodash intersection
_.intersectionWith(arr1, arr2, (a, b) => a === b.id)
filter find
arr1.filter(a => arr2.find(b => a === b.id))
filter findIndex
arr1.filter(a => arr2.findIndex(b => a === b.id) > -1)