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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 OPR/109.0.0.0 (Edition std-1)
Browser:
Opera 109
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
_
17434.0 Ops/sec
.f
68494.0 Ops/sec
for
118674.1 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 })