Skip to content

Instantly share code, notes, and snippets.

@vitvad
Created February 27, 2015 09:38
Show Gist options
  • Save vitvad/6c58725f48c9c938c864 to your computer and use it in GitHub Desktop.
Save vitvad/6c58725f48c9c938c864 to your computer and use it in GitHub Desktop.
Profile bb collection
var M = Backbone.Model.extend({});
var C = Backbone.Collection.extend({model: M});
var NUM = 100000;
var data = new Array(NUM);
data.forEach(function(item, i, list){
list[i] = {
a: i,
b: "test"+i,
c: "test"+(NUM - i)
}
});
console.profile("Backbone Collection " + NUM);
var cc = new C(data);
console.profileEnd("Backbone Collection " + NUM);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment