[kde-edu]: KTurtle 4 performance
Mauricio Piacentini
piacentini at kde.org
Fri Jan 18 21:00:10 CET 2008
Jeff Shipley wrote:
> Most stuff seems to run fairly quickly, I can draw a huge square spiral
> covering the entire canvas in a few seconds.
>
> Speeding everything up (at least for the full-speed execution mode) is
> going to be a priority for me for the 4.1 release.
I think you will find out that a large part of the slowdown (specially
if you have thousands of lines drawn) might be caused by our current
approach to graphics. Each line is a new QGV item. This can give us
several benefits, as we can scale the canvas to fit the size of the
window like it is now, and antialias will be maintained. The effect is
that now the "units" of measurement for the canvas are virtual, they do
not correspond 1:1 to pixels on the image or screen, and this is very
nice imo. It also enables other features like SVG export, maybe?
But when you have thousands (or maybe millions) of lines, refreshing can
be a bit slow. Do you think the slowdown is in drawing, or in
calculating? I also did not exhausted the possible QGV optimizations
related to management of dirty rects. These are supposed to improve even
more with Qt 4.4, and the usage pattern you mentioned for the fractal
sample seems to match exactly a corner case in QGV performance, outlined
by Andreas at
http://labs.trolltech.com/blogs/2008/01/08/accurate-update-regions-for-thin-qgraphicsitems/
Of course, it might be an issue with the parser and recursion as well, I
am not sure. Feel free to research this, but let me know if you are
ready to commit huge architectural changes, as I am planning to
experiment with a different approach to graphics as well (drawing on a
fixed canvas size pixmap instead of creating vectorial lines.)
Regards,
Mauricio Piacentini
More information about the kde-edu
mailing list