R-alpha: plot( pch = <character> ) is slow.. -- why ? --

Martin Maechler Martin Maechler <maechler@stat.math.ethz.ch>
Thu, 3 Jul 1997 17:54:51 +0200


Can anyone explain this to us :


> unlist(version)
              platform                   arch                     os 
"sparc-sun-solaris2.5"                "sparc"           "solaris2.5" 
                system                 status             status.rev 
   "sparc, solaris2.5"                 "Beta"                    "0" 
                 major                  minor                   year 
                   "0"                   "49"                 "1997" 
              language 
                   "R" 


# (The following is using  x11() and an  Ultrasparc I.
# You should decrease from '20000' if you have a slower machine):

> x <- runif(20000)

> for(i in 1:10) print(unix.time(plot(x)))
[1] 1.66 0.04 3.00 0.00 0.00
[1] 1.33 0.04 2.00 0.00 0.00
[1] 1.68 0.04 3.00 0.00 0.00
[1] 1.40 0.05 2.00 0.00 0.00
[1] 1.67 0.06 2.00 0.00 0.00
[1] 1.44 0.05 3.00 0.00 0.00
[1] 1.68 0.06 2.00 0.00 0.00
[1] 1.38 0.04 2.00 0.00 0.00
[1] 1.66 0.06 2.00 0.00 0.00
[1] 1.41 0.06 3.00 0.00 0.00
> 
> for(i in 1:10) print(unix.time(plot(x, pch='-')))
[1]  4.76  3.25 21.00  0.00  0.00
[1]  4.29  2.51 20.00  0.00  0.00
[1]  4.46  2.95 20.00  0.00  0.00
[1]  4.75  2.95 21.00  0.00  0.00
[1]  5.42  2.99 23.00  0.00  0.00
[1]  4.73  3.14 23.00  0.00  0.00
[1]  4.93  3.00 23.00  0.00  0.00
[1]  4.62  3.02 22.00  0.00  0.00
[1]  4.76  3.06 23.00  0.00  0.00
[1]  4.62  2.82 22.00  0.00  0.00
                ^^^^^
		this tells you that the DRAWING PROCESS is the slow thing.
		it takes about 10 times longer...


Why is x11 much faster in drawing pch=1 (a circle), than a simple "-" ?
Is this X11's `fault' ?

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-