Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Lodash difference efficiency
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Browser:
Chrome 143
Operating system:
Linux
Device Platform:
Desktop
Date tested:
3 months ago
Test name
Executions per second
native (n^2)
0.8 Ops/sec
lodash
151.7 Ops/sec
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.15/lodash.min.js"></script>
Script Preparation code:
n = 80000 list1 = Array.from({length: n}, () => Math.floor(Math.random() * n)) list2 = Array.from({length: n}, () => Math.floor(Math.random() * n))
Tests:
native (n^2)
diff = list1.filter(v1 => list2.find(v2 => v2 === v1))
lodash
diff = _.difference(list1, list2) console.log(diff)