I looked for threads on performance increase using delegation mechanism. I am talking about simple javascript, without jQuery or other tools/libraries.
Every element spawns events in the DOM tree, and they travel throughout it with bubbling mechanism.
Delegation works avoiding to create an event handler for each element, but catching more events in a single handler. Also, stopping bubbling, the handler can avoid the event to further propagate, if already correctly handled. Thus it would reduce resource consumption by the page.
But, if bubbling is not stopped, events spawn and propagate through all the DOM tree, so there is the same resource consumption in the page using delegation or not. And, if the delegated handler has to perform check on the source of the event, it would be also more consuming...
So, where is the performance gain in using delegation, beyond programming being more easy, simple, clean?
There is a way to avoid certain events to generate at all, or certain elements to spawn certain events at all, thus saving really much in resource use? For example, a simple text, on mouse over, generates many useless messages in a normal page; if that message is not to be handled, can it be prevented to be generated at source?