Save Collection

JavaScript performance comparison

Test case created


Does saving the collection object save us any significant time?

Preparation code

<script src=""></script>
<script src=""></script>
Benchmark.prototype.setup = function() {
    var NUM_RECORDS = 10000; //ten thousand
    var dummyData = new Array();
    var CrowdTorch = {};
    CrowdTorch.TestModel = Backbone.Model.extend({});
    CrowdTorch.TestCollection = Backbone.Collection.extend({
      model: CrowdTorch.TestModel
    var collection = new CrowdTorch.TestCollection();
    //insert dummy records into collection
    for (var i = 0; i < NUM_RECORDS; i++) {
      var id = i;
      var name = "Name " + i;
      var record = {
        "Id": id,
        "Name": name

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
New Instantiation
var a = new CrowdTorch.TestCollection(dummyData);
var b = new CrowdTorch.TestCollection(dummyData);
Use Previous Instantiation
var a = new CrowdTorch.TestCollection(dummyData);
var b = a;

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers


Comment form temporarily disabled.

Add a comment