[R] Calling R from a Perl script: much slower?

J.delasHeras at ed.ac.uk J.delasHeras at ed.ac.uk
Thu Sep 3 17:42:03 CEST 2009


Hello list,

I use R for microarray analysis.
One procedure I use takes a large matrix, and loops through it looking  
for specific rows, does an operation with them, and outputs a result  
(single row) as a row of another matrix. The loop goes on about 25000  
times.

When I run the loop directly from the R console itself, it takes about  
3 minutes in my computer. I'm ok with that.

Now, when that same code is ran from within a GUI we created using  
Perl (Tcl/Tkx) it's taking 25-30 minutes to run.

Within the R code I inserted a line so that it writes a little file  
every 1000th iteration of the loop, so that I can follow the progress.  
I don't understand why it takes 10x longer when ran from Perl.

I am not new to R, but I am new to using it within Perl or any other  
language. Is there a way to improve performance? What is the reason  
for the slower speed?

I'll happily provide the code if somebody wants it.

thank you.

Jose

-- 
Dr. Jose I. de las Heras                      Email: J.delasHeras at ed.ac.uk
The Wellcome Trust Centre for Cell Biology    Phone: +44 (0)131 6513374
Institute for Cell & Molecular Biology        Fax:   +44 (0)131 6507360
Swann Building, Mayfield Road
University of Edinburgh
Edinburgh EH9 3JR
UK
*********************************************
NEW EMAIL from July'09: nach.mcnach at gmail.com
*********************************************

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




More information about the R-help mailing list