Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Loop over object: lodash vs Object.entries 2
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
lodash.each
8562.0 Ops/sec
lodash.map
8503.6 Ops/sec
Object.entries for...of
4606.9 Ops/sec
vanilla for-loop w/ Object.entries
4606.1 Ops/sec
HTML Preparation code:
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js"></script>
Script Preparation code:
var obj = Array.from({ length: 10000 }).map((value, i) => i).reduce((val, v) => { val[v] = v; return val; }, {})
Tests:
lodash.each
_.each(obj, function(v, k) {})
lodash.map
_.map(obj, function(v, k) {})
Object.entries for...of
const entries = Object.entries(obj); for (const [k,v] of entries) { }
vanilla for-loop w/ Object.entries
const entries = Object.entries(obj); for (let i = 0; i < entries.length; i++) { const [k, v] = entries[i]; }