lodash clone vs lodash extend vs jquery extend (v19)

Revision 19 of this benchmark created by Aditya on


Preparation HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.2.1/lodash.min.js"></script>
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script>
window.o$ = $.noConflict();
window.deepObject = {
  a: {
    b: {
      c: 6
    },
    d: 8
  },
  e: "hello",
  p: 9,
  q: 10,
  r: true,
  s: new Date(),
  t: function () {}
};
</script>
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
lodash.clone
var bus = _.clone(deepObject);
ready
jquery.extend
var bus = o$.extend(false, {}, deepObject);
ready
lodash.extend
var bus = _.extend({},deepObject);
ready
jquery.extend (2.0)
var bus = $.extend(false, {}, deepObject);
ready

Revisions

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