[cairo] Very slow performance

Carl Worth cworth at cworth.org
Thu Dec 23 09:34:27 PST 2004


On Thu, 23 Dec 2004 09:54:59 -0500, Chris wrote:
> I have some fairly complex SVG artwork that I created.

Hi Chris,

Thanks for contributing a nice test case for us!

> I made a simple test program that loads this file and renders it to an
> image buffer in Cairo.  It takes over 30 seconds to do this.  That's
> incredibly slow and makes me wonder about the usability of Cairo in
> everyday applications.  

It is slow, and we'll need to fix that.

But cairo does render the whole thing correctly, right? That's
encouraging.

> Would rendering to OpenGL or xlib be faster?

OpenGL or Xlib might be faster, but that introduces a bunch of new
driver-specific questions about how well-supported the necessary
extensions are, etc.

Me, I'm more interested in getting the worst-case performance good
enough, which is software rendering to an image buffer as you are
doing. And I think here we still have a lot of room to speed things
up.

Though, when things like glitz and Render can make things go even
faster, that's lots of fun too.

> Where is the bottleneck?

Profiling will let us know for sure. Alexander Larsson has recently
demonstrated fantastic performance improvements for a specific
application by profiling first and optimizing the magic parts.

Your test case gives a perfect opportunity to do similar profiling.

I don't know if the profile will point to these parts, but I am aware
of a couple of potential performance problems in the current stack:

1) A tessellation implementation of excess complexity

2) High-overhead compositing implementation

I've got a plan for #1, and a partial implementation that I hope to
finish soon.

Keith has plans for #2, and I think we're still loking for a volunteer
to help implement one.

-Carl



More information about the cairo mailing list