Underscore extend vs jQuery extend (v4)

Revision 4 of this benchmark created by Halzy on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://underscorejs.org/underscore-min.js"></script>

Setup

var obj = {
    
      cats: 'furry animal that scratches your face',
      numberCats: 65,
      age: 1000,
      sound: 'meow?',
      cage: 'abcdefg',
      something: {
        goes: {
          here: {
            data: true
          }
        }
      },
      else :{
        goes: {
          here: {
            data: true
          }
        }
      },
      goes: {
        goes: {
          here: {
            data: true
          }
        }
      },
      here: {
        goes: {
          here: {
            data: true
          }
        }
      }
    
    
    };

Teardown


    obj = null;
  

Test runner

Ready to run.

Testing in
TestOps/sec
Underscore Extend
_.extend({}, obj);
ready
jQuery Extend
$.extend({}, obj);
ready

Revisions

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