backbone-vs-jquery-events

Benchmark created 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/caseywebdev/backbone/events/backbone.js'></script>

Setup

var jq = {};
    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
on/once/trigger/off - jQuery Cached
$jq.on('event', function () {});
$jq.one('other-event', function () {});
$jq.trigger('event');
$jq.trigger('other-event');
$jq.off('event');
ready

Revisions

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