| Internal class LCount is used to track the number of
listeners registered for a given event name, as an entry
in a global hashtable. This should allow us to avoid generating,
or discard, events for which no listeners are registered.
There should undoubtedly be methods here to manipulate
this table. At the moment that code's residing in NodeImpl.
Move it when we have a chance to do so. Sorry; we were
rushed.
Also, I'm currently asking "are there any listeners"
by testing captures+bubbles+defaults =? 0. It would probably
make sense to have a separate "total" field, calculated at
add/remove, to save a few cycles during dispatch. Fix.
???? CONCERN: Hashtables are known to be "overserialized" in
current versions of Java. That may impact performance.
???? CONCERN: The hashtable should probably be a per-document object.
Finer granularity would be even better, but would cost more cycles to
resolve and might not save enough event traffic to be worth the investment.
|