JS MVC Frameworks (No Spine) - Models

JavaScript performance comparison

Revision 14 of this test case created

Info

A comparison between 4 MVC frameworks' model instantiation performance. This shows the time to instantiate 500 simple models in Ember, Backbone and YUI3.

Preparation code

<script src="http://sb.taurus.uberspace.de/jslib/jquery-1.7.1.min.js">
</script>
<script src="http://sb.taurus.uberspace.de/jslib/underscore-1.3.1.min.js">
</script>
<script src="http://sb.taurus.uberspace.de/jslib/handlebars.1.0.beta.5.js">
</script>
<script src="http://cloud.github.com/downloads/emberjs/ember.js/ember-latest.min.js">
</script>
<script src="http://sb.taurus.uberspace.de/jslib/backbone-0.9.2.min.js">
</script>
<script src="https://rawgithub.com/ericf/yui3/attrs-model-perf-test/build/yui/yui-min.js">
</script>
<script>
Benchmark.prototype.setup = function() {
    YUI().use('model', function (Y) {
        var MyModelCore = function() {
            MyModelCore.superclass.constructor.apply(this, arguments);
        };
   
        MyModelCore.NAME = "myModel";
   
        Y.MyModelCore = Y.extend(MyModelCore, Y.BaseCore, {
            _allowAdHocAttrs : true
        });
   
        var MyModel = function() {
            MyModel.superclass.constructor.apply(this, arguments);
        };
   
        MyModel.NAME = "myModel";
   
        Y.MyModel = Y.extend(MyModel, Y.Base, {
            _allowAdHocAttrs : true
        });
   
        window.Y = Y;
    });
   
    modelData = {
      "label": 1,
      "description": "13301045681"
    };
};
</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
Ember
Ember.Object.create(modelData);
pending…
Backbone
new Backbone.Model(modelData);
 
pending…
YUI3 BaseCore
new Y.BaseCore(modelData);
pending…
YUI3 Model.Base
new Y.Model.Base(modelData);
pending…
YUI3 Model
new Y.Model(modelData);
pending…
YUI3 MyModelCore
new Y.MyModelCore(modelData);
pending…
YUI3 MyModel
new Y.MyModel(modelData);
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