From Weigand.Stephen at mayo.edu  Tue Sep 28 23:53:06 2010
From: Weigand.Stephen at mayo.edu (Weigand, Stephen D.)
Date: Tue, 28 Sep 2010 16:53:06 -0500
Subject: [Rd] Very slow plot rendering with X11 on CentOS 5.5
Message-ID: <0BDC4CE410E68F47BA74903185B3DC7702E5141A@MSGEBE12.mfad.mfroot.org>

I am connecting from a PC to a Linux system running CentOS
release 5.5 (Final) and it is extremely slow to render plots 
to the X11 device. 

This is not R's fault but I wonder if anyone can offer 
guidance so I can help the system administrators address 
the problem.

I can connect to the Linux server using a NoMachine NX client 
for Windows or using X-Win32. I also have access to R running 
on my Windows PC and an older version of R on Solaris which 
I connect to using X-Win32.

Using a test function of:

f <- function(n){
  for(i in 1:n) qqnorm(rnorm(100))
}
system.time(f(20))

I get typical timings of:

Platform Version Client    'type'  user  system elapsed
--------------------------------------------------------
Linux    2.11.0  NX client  cairo  1.012  0.131   7.155 
Linux    2.11.0  NX client  Xlib   0.964  0.127   7.119  

Linux    2.11.0  X-Win32    cairo  1.141  0.211  20.287
Linux    2.11.0  X-Win32    Xlib   1.116  0.207  20.152

Solaris  2.8.1   X-Win32    cairo  0.172  0.020   0.356
Solaris  2.8.1   X-Win32    Xlib   0.173  0.019   0.364

Win32    2.11.1  Native            0.03    0.22    0.25 


The Linux timings are just awful, particularly using 
X-Win32. Cairo vs. Xlib doesn't seem to matter much.

Does anybody have any suggestions on what to look into? 

I can work around the Linux problems by not using the X11 
device and instead writing a plot to a temporary PNG or 
PDF and using Eye of GNOME or Evince but that isn't ideal.
But I would welcome any tips in this regard.

The Linux sessionInfo is:

R version 2.11.0 (2010-04-22) 
x86_64-unknown-linux-gnu 

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base


Thank you,

Stephen

--
Stephen Weigand, Statistician II
Biomedical Statistics and Informatics
(507) 266-1650; fax (507) 284-9542
Mayo Clinic; 200 First St. SW
Rochester, Minn., 55905 USA 



[Rd] Very slow plot rendering with X11 on CentOS 5.5
Weigand, Stephen D.