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:
2 years ago
for
119K/s
.f
68K/s
_
17K/s
View exact numbers
Test name
Executions per second
✓
for
118,674 Ops/sec
.f
68,494 Ops/sec
_
17,434 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 })