Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash Chain vs Native vs Lodash && vs Native && vs Flow
(version: 1)
Comparing performance of:
Chain vs Native (with &&) vs Native vs Flow vs Chain (with &&)
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script> <script src='https://cdn.jsdelivr.net/g/lodash@4(lodash.min.js+lodash.fp.min.js)'></script>
Script Preparation code:
var data = Array(10000000).fill({ a: 'a', b: 1 });
Tests:
Chain
_.chain(data).filter(f => f.a === 'a').filter(f => f.b === 1).filter(f => f.b + 1 === 2).map(f => f.a).filter(f => f === 'a').value()
Native (with &&)
data.filter(f => f.a === 'a' && f.b === 1 && f.b + 1 === 2).map(f => f.a).filter(f => f === 'a')
Native
data.filter(f => f.a === 'a').filter(f => f.b === 1).filter(f => f.b + 1 === 2).map(f => f.a).filter(f => f === 'a')
Flow
_.flow( _.filter(f => f.a === 'a'), _.filter(f => f.b === 1), _.filter(f => f.b + 1 === 2), _.map(f => f.a), _.filter(f => f === 'a') )(data)
Chain (with &&)
_.chain(data).filter(f => f.a === 'a' && f.b === 1 && f.b + 1 === 2).map(f => f.a).filter(f => f === 'a').value()
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (5)
Previous results
Fork
Test case name
Result
Chain
Native (with &&)
Native
Flow
Chain (with &&)
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
5 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Browser/OS:
Chrome 142 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Chain
1.3 Ops/sec
Native (with &&)
2.2 Ops/sec
Native
0.5 Ops/sec
Flow
0.8 Ops/sec
Chain (with &&)
2.1 Ops/sec
Related benchmarks:
Filter-Map: Lodash FP vs Native code
Lodash Chain vs &&
Lodash Chain vs Native (with &&) vs Native (without &&) vs Flow
lodash head vs [0]
lodash vs es6 - filter then includes method3
lodash vs es6 - filter then includes method4
Lodash Chain (with &&) vs Native (with &&) vs Native (without &&) vs Flow
Lodash Chain vs Native vs Flow
Lodash Chain vs Native (with &&) vs Native (without &&) vs Flow, with actual filtering
Comments
Confirm delete:
Do you really want to delete benchmark?