Ember Model Test

JavaScript performance comparison

Revision 2 of this test case created by Karl Purkhardt

Preparation code

<div id="container"></div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.rc.1/handlebars.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/ember.js/1.0.0-pre.2/ember-1.0.0-pre.2.min.js"></script>

<script>
    var dataList = [];
    for (var i = 0; i < 100; i++) {
        dataList[dataList.length] = i;
    };

    function emberJS() {
        App = Ember.Application.create();

        App.Model = Ember.Object.extend();

        App.collection = Ember.ArrayController.create({content: []});

        for (var i = 0; i < dataList.length; i++) {
            App.collection.pushObject(App.Model.create({number: dataList[i]}));
        }
        
        App.view = Ember.View.create({
            template: Ember.Handlebars.compile("{{#each App.collection}}{{/each}}")
        });

        $(function() {
            App.view.appendTo('#container');
        });

    };
</script>
    

Preparation code output

<div id="container"></div> <script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.rc.1/handlebars.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/ember.js/1.0.0-pre.2/ember-1.0.0-pre.2.min.js"></script> <script> var dataList = []; for (var i = 0; i < 100; i++) { dataList[dataList.length] = i; }; function emberJS() { App = Ember.Application.create(); App.Model = Ember.Object.extend(); App.collection = Ember.ArrayController.create({content: []}); for (var i = 0; i < dataList.length; i++) { App.collection.pushObject(App.Model.create({number: dataList[i]})); } App.view = Ember.View.create({ template: Ember.Handlebars.compile("{{#each App.collection}}{{/each}}") }); $(function() { App.view.appendTo('#container'); }); }; </script>

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
Ember
emberJS()
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.

0 Comments