Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36
Chrome 110
Windows
Desktop
one year ago
Test name Executions per second
lodash.mapKeys 980575.6 Ops/sec
native 436309.2 Ops/sec
HTML Preparation code:
AخA
 
1
<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] })))