On Wed, 2011-01-19 at 22:46 +0100, Jürg Billeter wrote:
> On Wed, 2011-01-19 at 21:52 +0100, Sergej Reich wrote:
> > I know that calling interface methods is expensive and that it's a known
> > issue
> > in GLib but there is another problem. When a class implements an interface,
> > calling methods is slow regardless whether you declare your objects as being
> > instances of the class or the interface.
> >
> > [...]
> >
> > So my question would be whether this is intentional, maybe I'm missing
> > something?
> > If it is then interfaces have to be used even more carefully and you need
> > to use
> > a dummy class in between the interface just to be able to use your class
> > without
> > the extra overhead when the interface is not needed.
>
> Vala follows common GLib practice where possible and in the case of
> interface implementations, it's common practice to not export the method
> implementations directly and always use the interface wrapper functions
> instead.
>
> I understand that this may be a performance issue, however, deviating
> from common practice in that regard would work only with classes written
> in Vala and require many annotations in bindings of GLib/C libraries as
> they usually do not support direct calls. That's why I'd like to keep it
> the way it is. The plan for the Dova profile is to allow direct access
> to the method implementations for performance and other reasons.
>
> Jürg
>
Thank you for the clarification, of course consistency with other GLib
code is more important.
My main concern then would be with libraries like Gee. Right now all the
classes are implemented through abstract classes so the mentioned
problem is not noticeable but if Gee would use the interfaces directly
this would probably change.
Regards, Sergej
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list