jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="//documentcloud.github.com/underscore/underscore-min.js"></script>
<script src="//documentcloud.github.com/backbone/backbone-min.js"></script>
$("body").append("<div class='items'></div>");
var items = new Backbone.Collection();
for(var i=0 ; i < 300 ; i++){
items.add({title: "Item_" + i});
}
ListViewItem = Backbone.View.extend({
render: function(){
$(this.el).html("<div>" + this.model.get("title") +"</div>");
return this;
}
});
ListView = Backbone.View.extend({
addOne: function(item){
var item = new ListViewItem({model: item});
$(this.el).append(item.render().el);
},
render: function(){
this.collection.each(this.addOne);
return this;
}
});
FastListView = Backbone.View.extend({
render: function(){
var items = [];
this.collection.each(function(item){
items.push("<div>" + item.get("title") + "</div>");
});
return items.join();
}
})
$(".items").remove();
Ready to run.
Test | Ops/sec | |
---|---|---|
Render list view |
| ready |
Detach and render |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.