Spine Model Creation

JavaScript performance comparison

Revision 3 of this test case created by aeischeid

Info

Verify order fix doesn't trash performance

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script src="https://raw.github.com/spine/spine/chrome_order_fix/lib/spine.js">
</script>
<script>
Benchmark.prototype.setup = function() {
    var User = Spine.Model.sub();
    User.configure("User", "firstname", "lastname", "username");
};

Benchmark.prototype.teardown = function() {
    User.destroyAll();
};
</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
Create Models
for (var i = 0; i < 1000; i++) {
  var temp = new User({
    id: i,
    firstname: "dude",
    lastname: "big",
    username: "hey"
  })

  temp.save()
}
pending…
Create and destroy Models
for (var i = 0; i < 1000; i++) {
  var temp = new User({
    id: i,
    firstname: "dude",
    lastname: "big",
    username: "hey"
  })
  temp.save();
}

var array = User.all();
for (var i = 0; i < array.length; i++) {
  array[i].destroy();
}
pending…
create and destroyAll()
for (var i = 0; i < 1000; i++) {
  var temp = new User({
    id: i,
    firstname: "dude",
    lastname: "big",
    username: "hey"
  })
  temp.save();
}

User.destroyAll();
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