From: Alan W. I. <ir...@be...> - 2010-02-01 03:33:20
|
On 2010-01-31 16:50-0500 Hazen Babcock wrote: > Alan W. Irwin wrote: >> So the issue must be something special about the way xcairo implements the >> special interactive needs of example 17 that is done extremely >> inefficiently >> compared to all other interactive devices and also inefficiently compared >> to >> -dev pscairo. > > My guess is that this is due to this example heavily exercising the > PLESC_FLUSH pathway. In the case of the xcairo device I think that each > PLESC_FLUSH causes a complete redraw of the plot window from an off screen > image, which is probably located on your server computer. In the case of the > pscairo device PLESC_FLUSH is ignored (since there is nothing to see anyway). > Could you comment out the call to the blit_to_x() in PLESC_FLUSH in > plD_esc_xcairo and see if this improves the speed? You won't see anything > until the plot finishes, but hopefully it will get to the end a lot faster. That is the exact issue. If you comment out line 1735 in cairo.c which is "blit_to_x() in PLESC_FLUSH in plD_esc_xcairo", then xcairo loses its interactive capability (black screen until the end), but it reaches the end very quickly (and with no significant network traffic) and then displays the correct final result. > > If this is the problem then I'm not sure what the next step is. As I > understand it, Hez added the off screen image rendering to improve the > response of this device in some other redraw situations. Now that the issue has been narrowed down, I would recommend you and Hez have a look at what other interactive device drivers do to implement interactive effects efficiently. For example, Alban's final qt patch had the following log message (in part) that is relevant to the present discussion: r10346 | airwin | 2009-08-26 08:48:56 -0700 (Wed, 26 Aug 2009) | 13 lines AWI for Alban Rochel. Commit patch which does the following: + Better implementation of flushing, resulting in x17c -dev qtwidget running about as fast as x17c -dev xwin, a large improvement in qtwidget animation speed. In my opinion whatever algorithm he used there (IIRC it was a buffering technique of some kind) to drastically improve interactive speed for qtwidgets is likely to work well for the xcairo case. Revision 10346 is a big commit that changed other things as well so it will take some effort to figure out which part of it is relevant to interactive speed, but with some effort I hope you will be able to get some good ideas from that commit and also list discussion near the date of 2009-08-26. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |