Skip to content
Prev 12533 / 398502 Next

strange slowness of plot

On Tue, 24 Jul 2001, Duncan Murdoch wrote:

            
I tried Windows 2000 and it is slo....ow.  If you time the function with
system.time (on NT/2000) you will see that 99+% of the time is system time.
And some checking shows that it is all being spent in the call to
StrokePath.  In other words, the slowness is in the Windows 2000 GDI and
not in R.  As Duncan points out, Windows 9x/ME has a different (mainly
16-bit) GDI and behaves differently (I tried Windows 98: 0.54 vs 0.09
secs as reported by system.time).

The issue is too the number of dashes needed.  Drawing a sensible dashed
curve on 1000 points (say around a circle) is not slow.  It looks like the
Windows 2000 GDI is very slow when asked to stroke many dashes: doubling
the number seems to take ca 7x longer.  This might be dependent on the
graphics card driver, as well as on the Windows version.

Also, it does not take 15secs to plot the axes.  What actually happens is
that the plot is done twice, first on screen then on a bitmap (for later
copying to a bitmap device?).  That suggests that the GDI per se is to
blame.

I need to talk to Guido, but it looks as if breaking the draw up into
smaller pieces will solve this.  On the other hand, it must have been there
for a couple of years, and no one has reported problems on a real plot yet.