angular.extend vs underscore.extend

Benchmark created on


Preparation HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.5/angular.min.js">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js">
</script>

Setup

var a = {
      a: 1,
      b: 2,
      c: 3
    },
        b = {
        d: 4,
        e: 5,
        f: 6
        };

Test runner

Ready to run.

Testing in
TestOps/sec
angular.extend()
var c = angular.extend(a, b);
ready
underscore.extend()
var c = {};
_.extend(c, a, b);
ready

Revisions

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