HTML Preparation code:
AخA
 
1
<script src="//cdnjs.cloudflare.com/ajax/libs/ramda/0.25.0/ramda.min.js"></script>
2
<script src='https://cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js'></script>
Tests:
  • json stringify

     
    var obj = {a: "hello", c: "test", po: 33, arr: [1, 2, 3, 4], anotherObj: {a: 33, str: "whazzup"}};
    var obj2 = JSON.parse(JSON.stringify(obj));
  • lodash deep clone

     
    var obj = {a: "hello", c: "test", po: 33, arr: [1, 2, 3, 4], anotherObj: {a: 33, str: "whazzup"}};
    var obj2 = _.clone(obj, true);
  • Object.assign

     
    var obj = {a: "hello", c: "test", po: 33, arr: [1, 2, 3, 4], anotherObj: {a: 33, str: "whazzup"}};
    var obj2 = Object.assign({}, obj);
  • Ramda clone

     
    var obj = {a: "hello", c: "test", po: 33, arr: [1, 2, 3, 4], anotherObj: {a: 33, str: "whazzup"}};
    var obj2 = R.clone(obj);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    json stringify
    lodash deep clone
    Object.assign
    Ramda clone

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36
Chrome 81 on Windows
View result in a separate tab
Test name Executions per second
json stringify 290723.2 Ops/sec
lodash deep clone 919370.3 Ops/sec
Object.assign 2818468.8 Ops/sec
Ramda clone 419057.2 Ops/sec