[cairo] pycairo performance tips
a.g.nienhuis at gmail.com
Tue Aug 10 04:06:36 PDT 2010
Did you use a profiler on your code? What code is responsible for the bad
For panning you can render the whole image (even outside the visible window)
to an image and render that to the screen at the correct offset.
For zooming you can scale the cached image while zooming and then render to
the image again after the zooming is complete.
For editing you can drag a outline of the node that is selected across the
screen and render again at mouse-up.
On Tue, Aug 10, 2010 at 10:39 AM, Prashant Saxena <animator333 at yahoo.com>wrote:
> I am using cairo 1.8.6, wxpython 18.104.22.168 and python 2.6. I have created a
> custom OO based scene graph framework. I am using this frame work for a
> node based application. A similar screen shot can be found here:
> From functionality point of view cairo is working great but from
> wise it's slightly lagging. Although I have implemented
> a custom cache implementation to make it as fast as possible but still I
> some tips to improve it.
> Once a node is drawn it's cached as bitmap and instead of calling entire
> operations, I am drawing it's bitmap.
> The main area where I need speed-ups are related to view port navigation:
> 1. When you select a node and move, you have to repeatedly call the main
> to update the canvas and it's drawing all the nodes.
> 2. When you zoom-in or zoom-out (scaling DCs), you have to re-cache the
> 3. When you scroll/pan the canvas you have to draw all the nodes for every
> mouse-move call. This is much slower if you have already zoomed-in.(DC's
> is 5 or greater)
> Overall, how do you take out most of cairo/pycairo when you are creating a
> frame-work similar to the screen shot above?
> Shall I try newer version? (if there are any performance based improvements
> rather then functionality)
> cairo mailing list
> cairo at cairographics.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cairo