[Cosmo-dev] Dojo widget/event performance benchmarking
Matthew Eernisse
mde at osafoundation.org
Mon Nov 27 14:51:28 PST 2006
Bobby Rullo wrote:
> Are they loaded onto each widget, or are they methods of the superclass
> prototype? If they are from the superclass prototype, having extra
> methods don't incur a cost on instantiation. So there's no reason to be
> "appalled", unless they are being created in the constructor and the
> code is copied over each time.
Yeah, I should have cut that bit out -- the e-mail was originally
'general widget feedback,' and that paragraph referred to the humongous
dump of methods and props in the debugger when you inspect the widget
object. You can resort to debug statements referencing single property
names, or using hasOwnProperty, but that's pretty irritating when you
just want to inspect your object and see the properties you have
actually set yourself.
The actual list of not-mine props set directly on the object is really
modest -- so you're absolutely right, it's not inefficient from the
execution speed standpoint.
But until Joe Hewitt updates Firebug to give you a filter like
hasOwnProperty (doesn't look like that's in 1.0) or someone else builds
a better debugger, it is really inefficient from a development
standpoint, because trying to inspect my object dumps a unordered list
of more than (I thought it was only 60 or 70, but no, count 'em :)) 120
different properties and methods into the debugger.
Good point about performance though.
Matthew
More information about the cosmo-dev
mailing list