Ember RC5 ArrayProxy.addObjects Performance

JavaScript performance comparison

Revision 2 of this test case created by Joshua Kelly

Preparation code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<script src="https://raw.github.com/wycats/handlebars.js/1.0.0/dist/handlebars.js">
</script>
<script src="https://raw.github.com/emberjs/ember.js/release-builds/ember-1.0.0-rc.5.js">
</script>
<script>
Benchmark.prototype.setup = function() {
    window.array = Ember.ArrayProxy.create({content: Em.A()})
    array.addObject(Ember.Object.create({foo: "bar", fizz: "buzz", a: 1, b: 2}))
};
</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
ArrayProxy.addObject
array.addObject(Ember.Object.create({
  foo: "bar",
  fizz: "buzz",
  a: 1,
  b: 2
}));
array.addObject(Ember.Object.create({
  foo: "bar",
  fizz: "buzz",
  a: 1,
  b: 2
}));
array.addObject(Ember.Object.create({
  foo: "bar",
  fizz: "buzz",
  a: 1,
  b: 2
}));
array.addObject(Ember.Object.create({
  foo: "bar",
  fizz: "buzz",
  a: 1,
  b: 2
}));
pending…
ArrayProxy.addObjects
array.addObjects([
Ember.Object.create({foo: "bar", fizz: "buzz", a: 1, b: 2}), Ember.Object.create({foo: "bar", fizz: "buzz", a: 1, b: 2}), Ember.Object.create({foo: "bar", fizz: "buzz", a: 1, b: 2}), Ember.Object.create({foo: "bar", fizz: "buzz", a: 1, b: 2})
]);
pending…
ArrayProxy.setObjects
array.setObjects(array.get('content').concat([
Ember.Object.create({foo: "bar", fizz: "buzz", a: 1, b: 2}), Ember.Object.create({foo: "bar", fizz: "buzz", a: 1, b: 2}), Ember.Object.create({foo: "bar", fizz: "buzz", a: 1, b: 2}), Ember.Object.create({foo: "bar", fizz: "buzz", a: 1, b: 2})
]));
pending…
ArrayProxy.pushObject
array.pushObject(Ember.Object.create({
  foo: "bar",
  fizz: "buzz",
  a: 1,
  b: 2
}));
array.pushObject(Ember.Object.create({
  foo: "bar",
  fizz: "buzz",
  a: 1,
  b: 2
}));
array.pushObject(Ember.Object.create({
  foo: "bar",
  fizz: "buzz",
  a: 1,
  b: 2
}));
array.pushObject(Ember.Object.create({
  foo: "bar",
  fizz: "buzz",
  a: 1,
  b: 2
}));
pending…
ArrayProxy.pushObjects
array.pushObjects([
Ember.Object.create({foo: "bar", fizz: "buzz", a: 1, b: 2}), Ember.Object.create({foo: "bar", fizz: "buzz", a: 1, b: 2}), Ember.Object.create({foo: "bar", fizz: "buzz", a: 1, b: 2}), Ember.Object.create({foo: "bar", fizz: "buzz", a: 1, b: 2})
]);
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