[R] R - How to "physically" Increase Speed

Jim Holtman jholtman at gmail.com
Tue Oct 22 11:47:15 CEST 2013


I would start with taking a subset of the data (definitely some that would run in less than 10 minutes) and use the profiler "Rprof" to see where time is being spent.  you can use the the task monitor (if on windows) to see how much memory you are using; it sounds like you did not need the extra memory.

You might see if you can partition your data so you can run multiple versions of R and then merge the results.

Anything that takes more than a half hour, for me, is looked into to see where the problems are.  For example dataframes arevexpensive to access and conversion to matrices is one way to speed it up.  the is where the profiler helps.

Sent from my iPad

On Oct 21, 2013, at 19:12, Alexandre Khelifa <akhelifa at logitech.com> wrote:

> Hi,
> 
> My name is Alexandre Khelifa and I have been using R at my work for about 2
> years. I have been working on a project when we do Monte Carlo Simulation
> and it involves a lot of calculations.
> 
> I am currently using R x64.3.0.1 and used to work on a 4GB machine.
> However, the calculation time was very long (about 2 weeks), and the IT
> team and I decided to add more memory and to make it a 8GB virtual machine.
> I also added the following line in my code:
> *
> *
> 
>   - *options(java.parameters = "-Xmx8192m") *
> 
> 
> I re-did the same calculations (4GB vs. 8GB) but did not see a significant
> increase in the calculation time, so I was wondering if I did anything
> wrong and/or what would be the best solution to increase this time.
> 
> Thanks a lot for your help and more generally for building such an amazing
> (and free) tool.
> Let me know if you have any questions.
> 
> Regards,
> 
> Alexandre Khelifa
> 
>    [[alternative HTML version deleted]]
> 
> ______________________________________________
> 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.



More information about the R-help mailing list