[R] Speed up an R code

Jonathan Daily biomathjdaily at gmail.com
Fri May 27 20:16:00 CEST 2011


This is a very open ended question that depends very heavily on what
you are trying to do and how you are doing it. Often times, the
bottleneck operations that limit speed the most are not necessarily
sped up by adding RAM. They also often require special setup to run
multiple operations/iterations in parallel. Try some of the options at
the High Performance Computing task view for specifics.

http://cran.cnr.berkeley.edu/web/views/

HTH,
Jon

On Fri, May 27, 2011 at 2:00 PM, Debs Majumdar <debs_stata at yahoo.com> wrote:
> Hello,
>
>   Are there some basic things one can do to speed up a R code? I am new to R and currently going through the following situation.
>
>   I have run a R code on two different machines. I have R 2.12 installed on both.
>
>   Desktop 1 is slightly older and has a dual core processor with 4gigs of RAM. Desktop 2 is newer one and has a xeon processor W3505 with 12gigs of RAM. Both run on Windows 7.
>
>   I don't really see any significant speed up in the newer computer (Desktop 2). In the older one the program took around 5hrs 15 mins and in the newer one it took almost 4hrs 30mins.
>
>  In the newer dekstop, R gives me the following:
>
>> memory.limit()
> [1] 1024
>> memory.size()
> [1] 20.03
>
>  Is something hampering me here? Do I need to increase the limit and size? Can this change be made permanent? Or am I looking at the wrong place?
>
>  I have never seen my R programs using much CPU or RAM when it runs? If this is not something inherent to R, then I guess I need to write more effiecient codes.
>
>  Suggestions/solutions are welcome.
>
>   Thanks,
>
>   -Debs
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
===============================================
Jon Daily
Technician
===============================================
#!/usr/bin/env outside
# It's great, trust me.



More information about the R-help mailing list