[cairo] xtrace, part the second

MenTaLguY mental at rydia.net
Wed Dec 13 16:08:40 PST 2006


On Wed, 13 Dec 2006 15:12:56 -0800, Carl Worth <cworth at cworth.org> wrote:
> What I would suggest is a tiny little cache of patterns for use by
> cairo_set_source_rgb{,a}

Hmm, if there are going to be a lot of pattern-specific caches downstream, it seems like there's a lot of potential for "fanout" to make a big performance cliff when someone surpasses the number of colors in the pattern cache.

Why have a limit on the size of the solid pattern cache at all?  Patterns could still be evicted from the cache when their refcount fell to zero, and you'd only benefit from the additional sharing.  Solid patterns would essentially become a value type, a little bit like Lisp symbols.

Of course, the downstream caches would need to ref the "value patterns" in some way to keep them around and make that approach useful.  Perhaps special (internal?) ref/destroy functions which would be noops for most pattern types, but would ref/unref "value patterns"?

-mental



More information about the cairo mailing list