Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array Filter
(version: 10)
Lodash vs Array filter
Comparing performance of:
Lodash prop vs Lodash arrow function vs Lodash Object vs Array filter vs Arrray prototype filter vs Ramda filter vs Array prototype filter with thisArg
Created:
8 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/ramda/0.25.0/ramda.min.js"></script>
Script Preparation code:
function Rand(x) { return Math.floor(Math.random() * x); } const arr = R.map(x => { return {id: Rand(x)}; }, R.repeat(5, 1000)); function GetArray() { return arr; }
Tests:
Lodash prop
_.filter(GetArray(), 'id', 5);
Lodash arrow function
_.filter(GetArray(), i => i.id === 5);
Lodash Object
_.filter(GetArray(), {id: 5});
Array filter
GetArray().filter(i => i.id === 5);
Arrray prototype filter
Array.prototype.filter.call(GetArray(), i => i.id === 5);
Ramda filter
R.filter(i => i.id === 5, GetArray());
Array prototype filter with thisArg
GetArray().filter(i => i.id === 5, GetArray());
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (7)
Previous results
Fork
Test case name
Result
Lodash prop
Lodash arrow function
Lodash Object
Array filter
Arrray prototype filter
Ramda filter
Array prototype filter with thisArg
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
Lodash.filter vs array.filter
three lodash filter vs one native map
Lodash, Set, Array comparison v2
Lodash, Set, Array, Native comparison
Comments
Confirm delete:
Do you really want to delete benchmark?