Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Lodash Chain vs Native vs Lodash && vs Native && vs Flow
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:134.0) Gecko/20100101 Firefox/134.0
Browser:
Firefox 134
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
one year ago
Native (with &&)
4/s
Chain (with &&)
3/s
Native
2/s
Chain
2/s
Flow
2/s
View exact numbers
Test name
Executions per second
✓
Native (with &&)
4 Ops/sec
Chain (with &&)
3 Ops/sec
Native
2 Ops/sec
Chain
2 Ops/sec
Flow
2 Ops/sec
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()