Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Lodash DifferenceWith vs Pure JS
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/137.0.0.0 Safari/537.36 Edg/137.0.0.0
Browser:
Chrome 137
Operating system:
Windows
Device Platform:
Desktop
Date tested:
10 months ago
Test name
Executions per second
Pure JS
4076624.2 Ops/sec
Lodash diffrenceWith
4645219.0 Ops/sec
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.4/lodash.min.js"></script>
Script Preparation code:
var oldArr = [ { "id": 52 }, { "id": 76 }, { "id": 13 }, { "id": 96 }, { "id": 27 }, { "id": 8 }, { "id": 23 }, { "id": 63 }, { "id": 25 } ] var newArr = [ 52, 76, 13, 96, 27, 8, 23, 63, 25, 1 ]
Tests:
Pure JS
const currentIds = new Set(oldArr.map(e => e.id)); newArr.filter(id => !currentIds.has(id));
Lodash diffrenceWith
_.differenceWith(newArr, oldArr, (v, e) => v === e.id);