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, true);
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: 6 years ago)
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36
Chrome 64 on Windows 7
View result in a separate tab
Test name Executions per second
json stringify 286890.1 Ops/sec
lodash deep clone 910621.8 Ops/sec
Object.assign 825806.9 Ops/sec
Ramda clone 352255.1 Ops/sec