jQuery event delegation (v105)

Revision 105 of this benchmark created on


Description

Comparing performance of adding .click() to 100 table cells vs using .on() to listen for click events bubbling up the DOM tree.

Test runner

Ready to run.

Testing in
TestOps/sec
no delegation
$('a').find('test').on('click', function() {
  $(this).toggleClass('active');
});
ready
with delegation
$('a.test').on('click', function() {
  $(this).toggleClass('active');
});
ready

Revisions

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