W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2000

Re: Subclassing DOM nodes

From: Joseph Kesselman/Watson/IBM <keshlam@us.ibm.com>
Date: Thu, 12 Oct 2000 09:57:19 -0400
To: www-dom@w3.org
Message-ID: <OF938EA096.52C571F6-ON85256976.004B0863@pok.ibm.com>

>BTW, using events as an extensibility mechanism also
>implies that it needs to be FAST.  If the event course of
>extensibility is taken, there needs to be an investigation
>on how performance of the event system can be improved.
>I would not like to think that the DOM Events API
>intrinsically imposes a poor performance event system
>on all DOM Event implementations.

Designing for generality usually does impose some costs.The DOM Event
system may not be ideal for all applications which need event-like
behavior. It shouldn't have to perform "poorly" (though actual performance
is, as always, up to the individual implementation), but it may not perform
as well as an event system which was precisely tailored and tuned to a
specific application.

In this case: If all you want is to call an additional behavior on a single
node, the overhead of having to construct an object to carry its
parameters, having to look up the function by name, and having to be
prepared for the possibility that the event may be distributed to other
listeners all contribute overhead that wouldn't exist in the simple
subclassing case. It's roughly the same kind of overhead as calling a Java
method via reflection... _plus_ having to search for capturing handlers,
even if bubbling is turned off.

______________________________________
Joe Kesselman  / IBM Research
Received on Thursday, 12 October 2000 09:58:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:48 GMT