Delegate vs Live vs Bind (v5)

Revision 5 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<button id="sendBtn">Send</button>
<script>
  var $panel = $("#panel");
  var $btn = $panel.find("#sendBtn");
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
bind
$btn.mouseover(function() {})
.mouseout(function() {})
.click(function() {});
ready
delegate
$panel.delegate("#sendBtn", "mouseover", function() {})
.delegate("#sendBtn", "mouseout", function() {})
.delegate("#sendBtn", "click", function() {});
ready
live
$btn.live("mouseover", function() {})
.live("mouseout", function() {})
.live("click", function() {});
ready

Revisions

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