HTML Preparation code:
x
 
1
2
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/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 };
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    lodash merge
    object.assign
    spread

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Windows NT 10.0; rv:103.0) Gecko/20100101 Firefox/103.0
Firefox 103 on Windows
View result in a separate tab
Test name Executions per second
lodash merge 3508036.2 Ops/sec
object.assign 11175928.0 Ops/sec
spread 5040421.5 Ops/sec