jQuery 2.1.1 - .delegate() vs .on() vs bind() (v81)

Revision 81 of this benchmark created on


Preparation HTML

<script src="//code.jquery.com/jquery-2.1.1.min.js"></script>

<div id="context">
<p>Some paragraph</p>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
.delegate()
$('#context').delegate('p', 'click', $.noop);
ready
.delegate() on document
$(document).delegate('p', 'click', $.noop);
ready
.on()
$('#context').on('click', 'p', $.noop);
ready
.on() on document
$(document).on('click', 'p', $.noop);
ready
.on() with context
$('#context p').on('click', $.noop);
ready
.bind() with context
$('p', $('#context')).bind('click', $.noop);
ready
.bind() with context in selector
$('#context p').bind('click', $.noop);
ready
.on() on document with context
$(document).on('click', '#context p', $.noop);
ready

Revisions

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