Events vs Events2
JavaScript performance comparison
Preparation code
<script src='https://raw.github.com/documentcloud/underscore/master/underscore.js'></script>
<script src='https://raw.github.com/caseywebdev/backbone/events/backbone.js'></script>
<script>var one = Backbone.Events;</script>
<script src='https://raw.github.com/caseywebdev/backbone/events2/backbone.js'></script>
<script>var two = Backbone.Events;</script>
<script>
Benchmark.prototype.setup = function() {
var obj1 = _.extend({}, one);
var obj2 = _.extend({}, two);
var i, l = 20;
};
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
on/off (many events) - one |
|
pending… |
on/off (many events) - two |
|
pending… |
trigger (many events) - one |
|
pending… |
trigger (many events) - two |
|
pending… |
on/trigger/off (3 events) - one |
|
pending… |
on/trigger/off (3 events) - two |
|
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:
- Revision 1: published
- Revision 2: published by Jeremy Ashkenas
- Revision 3: published by Jeremy Ashkenas
- Revision 4: published by Jeremy Ashkenas
- Revision 5: published
- Revision 6: published
- Revision 7: published
- Revision 8: published by Jeremy Ashkenas
- Revision 9: published
- Revision 10: published by Romain Beauxis
- Revision 12: published
- Revision 14: published
- Revision 15: published
- Revision 16: published by Tim Griesser
- Revision 17: published
- Revision 19: published
- Revision 20: published
- Revision 21: published
- Revision 22: published
- Revision 23: published
- Revision 24: published
- Revision 33: published
- Revision 34: published
- Revision 35: published by stefan
- Revision 36: published by stefan
- Revision 38: published by stefan and last updated
0 comments