Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Firefox 89
Windows
Desktop
3 years ago
Test name Executions per second
lodash merge 3465962.5 Ops/sec
object.assign 10290487.0 Ops/sec
spread 3740214.2 Ops/sec
HTML Preparation code:
x
 
1
2
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Tests:
  • lodash merge

     
    var a = { a: 'oh', b: 'my' };
    var b = { c: 'goddess' };
    var c = _.merge(a, b);
  • object.assign

     
    var a = { a: 'oh', b: 'my' };
    var b = { c: 'goddess' };
    var c = Object.assign(a, b);
  • spread

     
    var a = { a: 'oh', b: 'my' };
    var b = { c: 'goddess' };
    var c = { ...a, ...b };