Re: g_type_instance_is_a (was Cairo 1.3 performance loss)
- From: Matthias Clasen <mclasen redhat com>
- To: michael meeks novell com
- Cc: performance-list <performance-list gnome org>
- Subject: Re: g_type_instance_is_a (was Cairo 1.3 performance loss)
- Date: Thu, 25 Jan 2007 09:33:37 -0500
On Thu, 2007-01-25 at 11:10 +0000, Michael Meeks wrote:
> if (GDK_IS_PAINTABLE (private->impl) &&
>
> [ also interesting that we call:
> GDK_PAINTABLE_GET_IFACE (private->impl)->invalidate_maybe_recurse)
> twice back-to-back, (which takes a mutex) when we should just
> store the pointer for later use ].
>
> > gdk_window_begin_paint_region
>
> The same code �cut/pasted there too it seems.
>
> It seems the Paintable interface is used by the directfb and quartz
> backends, but otherwise shouldn't be used; I would imagine it would be
> easy to add a flag / method "is_paintable" that could be used instead of
> a GInterface check here though.
Thanks for pointing that out. I've applied the usual fix for now to just
get the iface once. If that turns out to be still too much overhead, we
can go to more drastic measures, like an is_paintable flag.
> > gdk_drawable_get_screen
>
> Strangely this isn't wrt. an interface; perhaps that scuppers the idea
> that it's lock taking that is slow:
>
> g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
>
> OTOH, perhaps this is called millions of times (?). Clearly since there
> are only a really small number of drawables, this could have some '?'
> operator goodness & special cases for the most common types of drawable.
I'll look at this.
> > gtk_widget_style_get
>
> similarly, this only calls:
>
> g_return_if_fail (GTK_IS_WIDGET (widget));
>
> perhaps it just happens millions of times; odd.
>
and at this one too.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]