angular.extend vs underscore.extend

JavaScript performance comparison

Revision 3 of this test case created

Preparation code

<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.5/angular.min.js">
</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js">
</script>
<script>
Benchmark.prototype.setup = function() {
    var a = {
      a: 1,
      b: 2,
      c: 3
    },
        b = {
        d: 4,
        e: 5,
        f: 6
        };
};
</script>

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
angular.extend()
var a = angular.extend(a, b);
pending…
underscore.extend()

_.extend(a, b);
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment