Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Lodash vs native (filter)
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15
Browser:
Safari 17
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
_
126750.0 Ops/sec
.f
96179.8 Ops/sec
for
56702.6 Ops/sec
HTML Preparation code:
<script src="lodash.js"></script>
Script Preparation code:
var array = [] for (let i = 0; i < 10000; i++) { array.push({ value: i }) }
Tests:
_
_.filter(array, (item) => { return item.n > 5000 })
.f
array.filter((item) => { return item.n > 5000 })
for
const _filter = ( collection, filterCallback, ) => { let index = 0 const result = [] for (const item of collection) { if (filterCallback(item, index, collection)) { result.push(item) } index++ } return result } _filter(array, (item) => { return item.n > 5000 })