11

Can someone help with a clear description on the cost of event listeners? My empirical evidence is in small docs vs large docs & event delegation improvements... but I was hoping for the concrete explanation of the process- and what about it is costly.

I assume the issue is just the sheer amount of functions attached to object properties on large docs (more objects, more properties, with listeners, more functions)?

Nic
  • 4,621
  • 3
  • 19
  • 12

1 Answers1

0

This reference seems to imply that adding lots of event handlers increases memory usage (using more resources potentially slows down your application): http://gregfranko.com/blog/javascript-performance-tips/

Looks like the answer here is much more comprehensive: event delegation vs direct binding when adding complex elements to a page

Community
  • 1
  • 1
B T
  • 57,525
  • 34
  • 189
  • 207