[cairo] cairo-xlib patch to release glyph surfaces

BJörn Lindqvist bjourne at gmail.com
Thu Oct 18 06:52:46 PDT 2007


Hello!

On 10/18/07, Behdad Esfahbod <behdad at behdad.org> wrote:
> I'd like to commit the attached patch to cairo-xlib that makes it
> release glyph surface after uploading it to the X surface iff the
> surface didn't exist in the cache before we asked for it.
>
> The reasoning is that right now, applications render glyphs to images,
> upload it to the X server, and keep a local copy in the cache.  The X
> server works hard to reuse glyph renderings, by hashing glyph images and
> reusing them.  So we are wasting memory in cairo apps that don't use the
> glyph surface after uploading to the server, which is the case if you
> don't use the glyph in an image surface.

So the patch reduces memory consumption? Is there a way to measure the
improvment? For example, if I have an app that takes 1800kb memory
without and 1300kb with the patch applied. And thinking along the same
lines.. Cairo already has correctness tests and performance tests,
maybe tests that check memory consumption would also be useful?

-- 
mvh Björn


More information about the cairo mailing list