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 (iPhone; CPU iPhone OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 17
Operating system:
iOS 17.5.1
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
_
126687.2 Ops/sec
.f
89825.6 Ops/sec
for
54722.2 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 })