backbone-vs-jquery-events (v2)

Revision 2 of this benchmark created by Jeremy Ashkenas on


Preparation HTML

<script src='http://code.jquery.com/jquery-1.8.3.js'></script>
<script src='https://raw.github.com/documentcloud/underscore/master/underscore.js'></script>
<script src='https://raw.github.com/documentcloud/backbone/master/backbone.js'></script>

Setup

var jq = $({});
    var bb = _.extend({}, Backbone.Events);

Test runner

Ready to run.

Testing in
TestOps/sec
on/once/trigger/off - jQuery
jq.on('event', function () {});
jq.one('other-event', function () {});
jq.trigger('event');
jq.trigger('other-event');
jq.off('event');
ready
on/once/trigger/off - Backbone
bb.on('event', function () {});
bb.once('other-event', function () {});
bb.trigger('event');
bb.trigger('other-event');
bb.off('event');
ready

Revisions

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