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 = {     "_id": "624863161dde7aa8538857e6",
        "index": 0,
        "guid": "4be322b0-459c-41aa-bd09-f3227cd353df",
        "isActive": false,
        "balance": "$3,816.12",
        "picture": "http://placehold.it/32x32",
        "age": 26,
        "eyeColor": "brown",
        "name": "Caitlin Beach",
        "gender": "female",
        "company": "MICROLUXE",
        "email": "caitlinbeach@microluxe.com",
        "phone": "+1 (954) 462-3548",
        "address": "854 Sapphire Street, Biddle, Colorado, 1002",
        "about": "Adipisicing proident labore qui est minim tempor. Ipsum est cillum nisi exercitation laboris irure. Enim tempor elit quis est deserunt cupidatat dolore. Mollit aliquip enim proident non commodo non sunt tempor nisi elit. Deserunt ex proident mollit esse. Ea Lorem sit ipsum occaecat ad ullamco.\r\n",
        "registered": "2018-03-22T05:20:17 +07:00",
        "latitude": 69.438455,
        "longitude": 113.552142 };
    var b = {     "eyeColor": "bdrown",
        "name": "Caitlind Beach",
        "gender": "femalde",
        "company": "MICRdOLUXE",
        "email": "caitlindbeach@microluxe.com",
        "phone": "+1 (954)d 462-3548", };
    var c = _.merge(a, b);
  • object.assign

     
    var a = {     "_id": "624863161dde7aa8538857e6",
        "index": 0,
        "guid": "4be322b0-459c-41aa-bd09-f3227cd353df",
        "isActive": false,
        "balance": "$3,816.12",
        "picture": "http://placehold.it/32x32",
        "age": 26,
        "eyeColor": "brown",
        "name": "Caitlin Beach",
        "gender": "female",
        "company": "MICROLUXE",
        "email": "caitlinbeach@microluxe.com",
        "phone": "+1 (954) 462-3548",
        "address": "854 Sapphire Street, Biddle, Colorado, 1002",
        "about": "Adipisicing proident labore qui est minim tempor. Ipsum est cillum nisi exercitation laboris irure. Enim tempor elit quis est deserunt cupidatat dolore. Mollit aliquip enim proident non commodo non sunt tempor nisi elit. Deserunt ex proident mollit esse. Ea Lorem sit ipsum occaecat ad ullamco.\r\n",
        "registered": "2018-03-22T05:20:17 +07:00",
        "latitude": 69.438455,
        "longitude": 113.552142 };
    var b = {     "eyeColor": "bdrown",
        "name": "Caitlind Beach",
        "gender": "femalde",
        "company": "MICRdOLUXE",
        "email": "caitlindbeach@microluxe.com",
        "phone": "+1 (954)d 462-3548", };
    var c = Object.assign({}, a, b);
  • spread

     
    var a = {     "_id": "624863161dde7aa8538857e6",
        "index": 0,
        "guid": "4be322b0-459c-41aa-bd09-f3227cd353df",
        "isActive": false,
        "balance": "$3,816.12",
        "picture": "http://placehold.it/32x32",
        "age": 26,
        "eyeColor": "brown",
        "name": "Caitlin Beach",
        "gender": "female",
        "company": "MICROLUXE",
        "email": "caitlinbeach@microluxe.com",
        "phone": "+1 (954) 462-3548",
        "address": "854 Sapphire Street, Biddle, Colorado, 1002",
        "about": "Adipisicing proident labore qui est minim tempor. Ipsum est cillum nisi exercitation laboris irure. Enim tempor elit quis est deserunt cupidatat dolore. Mollit aliquip enim proident non commodo non sunt tempor nisi elit. Deserunt ex proident mollit esse. Ea Lorem sit ipsum occaecat ad ullamco.\r\n",
        "registered": "2018-03-22T05:20:17 +07:00",
        "latitude": 69.438455,
        "longitude": 113.552142 };
    var b = {     "eyeColor": "bdrown",
        "name": "Caitlind Beach",
        "gender": "femalde",
        "company": "MICRdOLUXE",
        "email": "caitlindbeach@microluxe.com",
        "phone": "+1 (954)d 462-3548", };
    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: 3 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36 Edg/100.0.1185.29
Chrome 100 on Windows
View result in a separate tab
Test name Executions per second
lodash merge 1709183.1 Ops/sec
object.assign 1601761.8 Ops/sec
spread 8181083.0 Ops/sec