jQuery .live() vs .delegate() vs .on() (v70)

Revision 70 of this benchmark created on


Preparation HTML

<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<div id="context">
<p>Some paragraph</p>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
.live()
$('p').live('click', $.noop);
ready
.live() with context
$('p', $('#context')).live('click', $.noop);
ready
.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
alias
$('p').click($.noop);
ready
no delegation on
$('p').on('click',$.noop);
ready

Revisions

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