Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
lodash.mapKeys vs Iterating over Object.keys
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/148.0.0.0 Safari/537.36
Browser:
Chrome 148
Operating system:
Windows
Device Platform:
Desktop
Date tested:
3 months ago
Benchmark engine:
Benchmark.js
lodash.mapKeys
6.0M/s
native
2.5M/s
View exact numbers
Test name
Executions per second
✓
lodash.mapKeys
6,009,535 Ops/sec
native
2,513,752 Ops/sec
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/lodash/4.16.0/lodash.min.js"></script>
Script Preparation code:
var value = {a: 30310, b: 100303, c: 3040494};
Tests:
lodash.mapKeys
_.mapKeys(value, k => k + '-changed')
native
Object.assign({}, ...Object.keys(value).map(k => ({ [k + '-changed']: value[k] })))