JSON.parse + JSON.stringify vs _.cloneDeep (v3)

Revision 3 of this benchmark created by K Chandrasekhar Omkar on


Preparation HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.min.js"></script>
 
  };

  Benchmark.prototype.teardown = function() {
    document.writeln("<code>"+event+"</code>");
  };
</script>

Setup

Benchmark.prototype.setup = function() {
    <script type="text/javascript"  src="//econsultdev.eunoia.us/views/scripts/js/Chat.js">

Test runner

Ready to run.

Testing in
TestOps/sec
JSON.parse + JSON.stringify
var ergebnis = JSON.parse(JSON.stringify(x))
ready
_.cloneDeep
var ergebnis = _.cloneDeep(x);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.