Re: GObject extension propose (GContainer)



Alan M. Evans wrote:
[...]

the lookup penalties are negligible.
type node/class lookups and is_a checks are O(1);
interface class lookups and conforms_to checks are O(ld(N)), where
N is the number of interfaces a type node conforms to.

Your assertion that the penalties are negligable is not really supported
by your response, unless the constant is also known for both orders.
From my swift glance at gtype.c, it seems that in the case of
an interface, the implementing interface is searched on that class's
list of implementing interfaces... so when classes implement
hundreds of interfaces it might be a performance hit.

I dont think we've yet reached the day that we have to ditch good design
and avoid using interfaces because of performance woes, that would
be sorry day indeed... (I also dont think GTK+ code will be the only OO code
needing major refactoring in those areas too... if these interface lookups weren't
negligable)

Cheers,
                                    -Tristan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]