I checked with the S-PLUS development team (thanks, Michael!) on this issue.
Unfortunately, it seems there is no easy solution here. The bitmap file
writing ("JPEG", "TIFF", "PNG", "PNM", or "BMP) is all done in the Java
"Advanced Imaging" package. S-PLUS calls into this package to create a jpeg
(png, etc) driver, and draw to it. If the Java folks ever make faster
versions of
these routines, we will of course include them in S-PLUS.
Postscript and pdf files are created quickly as they call internal C code
written by Insightful.
Incidentally, the reason that all of the time is under dev.off() is that
none of the file writing is done until the device is closed: at this point,
the current graphics commands are drawn to the file.
# David Smith
--
David M Smith <dsmith@insightful.com>
S-PLUS Product Marketing Manager, Insightful Corp, Seattle WA
Tel: +1 (206) 283 8802 x360
Fax: +1 (206) 283 0347
MathSoft is now Insightful! See www.insightful.com for details.
> -----Original Message-----
> From: s-news-owner@lists.biostat.wustl.edu
> [mailto:s-news-owner@lists.biostat.wustl.edu]On Behalf Of Don MacQueen
> Sent: Wednesday, February 21, 2001 11:07
> Cc: s-news@wubios.wustl.edu
> Subject: [S] Graphics driver speeds
>
>
> This is a problem for which I am afraid there is no (current)
> solution--but if there is one, I would very much appreciate hearing
> about it.
>
> The new java-based graphics drivers are very slow compared to the
> older non-jave drivers. Here is some output to show this. For
> example, in this run, creating a PNG file took 254 times as long
> (elapsed time) as a PDF file. Most of the time appears to be used
> during the execution of dev.off().
>
> Source code that created the matrix of times is given below.
>
>
> usr sys elapsed child.usr child.sys
> pdf.time 0.10 0.00 0.18 0.00 0.00
> eps.time 0.28 0.07 1.17 0.12 0.29
> ps.time 0.30 0.05 1.30 0.16 0.32
> jpeg.time 14.02 0.04 18.20 0.00 0.00
> png.time 35.93 0.06 45.80 0.00 0.00
>
> Note:
> > version
> Version 6.0 Release 1 for Sun SPARC, SunOS 5.6 : 2000
>
>
> ----- Source code ------
> ps.time <- unix.time({
> postscript("foo.ps", onefile = T, print.it = F)
> plot(1:3)
> dev.off()
> })
>
> eps.time <- unix.time({
> postscript("foo.eps", onefile = F, print.it = F)
> plot(1:3)
> dev.off()
> })
>
> pdf.time <- unix.time({
> pdf.graph("foo.pdf", width = 6, height = 4)
> plot(1:3)
> dev.off()
> })
>
> jpeg.time <- unix.time({
> java.graph("foo.jpeg", format = "")
> plot(1:3)
> dev.off()
> })
>
> png.time <- unix.time({
> java.graph("foo.png", format = "PNG")
> plot(1:3)
> dev.off()
> })
>
>
> names(pdf.time) <- c("usr", "sys", "elapsed", "child.usr", "child.sys")
> drvr.times <- rbind(pdf.time, eps.time, ps.time, jpeg.time, png.time)
>
> print(drvr.times)
> --
> --------------------------------------
> Don MacQueen
> Environmental Protection Department
> Lawrence Livermore National Laboratory
> Livermore, CA, USA
> --------------------------------------
> ---------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu. To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message: unsubscribe s-news
>
|