Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Max value: Lodash vs native array functions
Compare native
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/120.0.0.0 Safari/537.36
Browser:
Chrome 120
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
Native array functions
12181.5 Ops/sec
Lodash
16281.7 Ops/sec
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.10/lodash.min.js'></script>
Script Preparation code:
var values = Array(10000).fill(null).map((x, a) => ({number: a})); var filterFn = x => !(x.number % 5); var mapFn = x => x.number; var reduceFn = (a, b) => a > b ? a : b;
Tests:
Native array functions
const result1 = values.filter(filterFn).map(mapFn).reduce(reduceFn); console.log(result1);
Lodash
const result2 = _(values).filter(filterFn).map(mapFn).max(); console.log(result2);