[R] Speed up R

Michael Prager mike.prager at noaa.gov
Thu Jun 21 01:23:50 CEST 2007


Matthew Keller wrote:

> So Mike, let me ask you a question. If R runs out of RAM, does it
> begin to use virtual RAM, and hence begin to swap from the hard drive?
> If so, I could see how a faster hard drive would speed R up when you
> don't have enough RAM...

Yes. Virtual memory management is done by any modern operating
system. The slowdown will be extreme.  (Therefore, a minimum
of 2Gb is a good idea for serious crunching -- I'd recommend 3
or 4 if possible.  Don't forget that any programming language
may have two copies of some arrays in memory during certain
operations.)

But even when R itself is not using VM, any significant I/O
load on a Windows CPU (when (S)ATA disks are used) slows down
*at least* all other I/O, and it seems to me that it slows
down other interrupt servicing (e.g., responding to mouse
clicks) as well.  Even if the latter is not strictly true, it
may be that the mouse click requires paging something in, like
the stupid animation that plays when files are copied.  

Aside:  On a old PC, copying files from the command line was
fine, but if I forgot & did it from the Windows Explorer, the
stupid animation swapped in from disk and the machine froze
for ~30 seconds.)

Windows Vista can take advantage of a new gizmo Intel has
introducted with a 1 Gb solid-state disk cache. That might
reduce such problems.

Mike

Mike Prager
Southeast Fisheries Science Center, NOAA
Beaufort, North Carolina  USA



More information about the R-help mailing list