Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Lodash: differenceBy vs filter & some
Comparing performance of: lodash differenceBy with javascript filter and find
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Browser:
Chrome 132
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Lodash differenceBy
6127492.5 Ops/sec
javascript filter and some
12299446.0 Ops/sec
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/lodash/4.16.0/lodash.min.js"></script>
Script Preparation code:
var fullArray = [ { title: 'full arr 1', value: '1', }, { title: 'full arr 2', value: '2', }, { title: 'full arr 3', value: '3', } ] var partialArray = [ { value: '1', }, { value: '3', } ]
Tests:
Lodash differenceBy
_.differenceBy( fullArray, partialArray, 'value', )
javascript filter and some
fullArray.filter(full => !partialArray.some(par => String(par.id) === full.value))