Re: performance of goocanvas




Hi Damon,


1. When drawing we draw a line between the two last sampled
points. Goocanvas takes enough time to affect the responsiveness of the
drawing. I have fixed this problem by drawing directly to the canvas
using cairo, and once the pen is lifted, I draw the polygon using
goocanvas. So far this seems to be adequate.

2. Scrolling. This is where the performance is really affected. A page
full of text might have literally thousands of line segments that need
to be scrolled. Also, we currently support a mode in which the user can
have in a huge vertical canvas all the pages of a document (a huge
column with one page per row). The performance seems to be affected by
whether we use one page at a time, or all pages in the canvas.

Do you have any suggestions to improve performance?

 Damon> Try to place items in groups, e.g. each page in a group. Then the entire
 Damon> page can be skipped when not needed. It shouldn't matter how many pages
 Damon> there are then.

We do this already.

 Damon> Setting "antialias" to CAIRO_ANTIALIAS_NONE for the polylines may help.

I'll try this.

 Damon> Is the main problem with GooCanvasPolyline items? Maybe try to minimize
 Damon> the number of line segments if possible.

It is an idea, but it will still be affected by the 

 Damon> Do you have a demo file that shows the problems?


To be honest, I am not sure. I have created a good test case.



http://turingmachine.org/~dmg/temp/test.xoj

It is a gzip XML file. You can inspect it with gunzip -c <file> 

Each stroke is a polygon. Most letters will be around dozens of strokes.

Open the file and make sure that you have xournal in continuous mode
(Menu: View/Continuous).

I suspect you can get xournal installed from your Linux
distribution. Try opening the file. it will be slow, but once open, the
scrolling is smooth. 

If I try to open it with the version that has gtk3 (it is also slow to
load, so be patient :) but then it is very slow to scroll. It slows when
it has to display a new page.

I am not saying it is not a bug in my code :) that I might have
introduced during porting, so I will also inspect the scroll event to
make sure that I am not doing anything to slow it down.

thanks again, Damon,


 Damon> Damon



--
Daniel M. German                  "An intellectual is someone whose
   Albert Camus ->                  mind watches itself. "
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .

 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]