Files
ladybird/Libraries/LibWeb/DOM/EventDispatcher.cpp
Jelle Raaijmakers 57c9bb5caa LibWeb: Skip event dispatching work if there are no relevant listeners
We were going through path building, retargeting, capturing/bubbling
phases etc. for each event that we were dispatching. We now optimize for
the case where there are no listeners for the event type on the target
node nor its ancestors by skipping all that work.

This decimates methods that depend on event dispatching like
`Document::set_hovered_node()` when there are no relevant listeners,
which reduced its runtime by 99% (42.5ms -> 0.5ms) on my machine for
sites like https://wordsalad.online/.
2026-03-10 16:57:36 +01:00

21 KiB