0

Im using a genetic algorithm (witness.genetic from package "witness") to fit a model to a dataset. The current system time is taking 61 hours on this machine:

Intel Core i7-2640M CPU @ 2.80 GHz 2.80 GHz RAM: 4 GB OS: 64-bit windows

I want to speed up this process. In my research so far its seems there are memory issues both with storage of a vector (for a 64-bit ) and processing speed. Will improving my hardware help with speed up a genetic algorithm or the speed limited by the OS. IF the former, what aspects of my hardware should I focus on?

  • 64-bit Windows? Does that mean XP/7/8/Server, etc? – Geobits Oct 11 '13 at 16:02
  • Your RAM is very small for working with R. However, I doubt that adding more RAM (though it is advisable if you use this machine for R on a regular basis) will help the performance if your system doesn't use virtual memory. Does it use virtual memory? – Roland Oct 11 '13 at 16:06
  • 4
    There is no way to accurately answer this question unless you provide a significant amount of details. The easiest way to do so would be to provide a [minimal, reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). Is your problem CPU-bound, memory-bound, I/O-bound? Can it be run in parallel? Could you use a different optimizer? – Joshua Ulrich Oct 11 '13 at 16:08
  • You haven't even fully utilized your current machine, why use 64bit vectors when you have AVX? Having that said, a Haswell machine (core i*-4xxx, usually), would provide AVX2 which may further assist you if you're bottlenecked on vector execution. That's a big 'if' though.. – Leeor Oct 11 '13 at 19:36

1 Answers1

1

The answer is almost always to write a better algorithm! Moore's law says upgrading a 10 year old computer will give a 32 times speed-up. But designing a O(n log n) algorithm to replace a O(n**2) algorithm will give a 2500 speed up (assuming there are 10k items).

Read Steven Skiena's Algorithm Design Manual for examples.

Colonel Panic
  • 132,665
  • 89
  • 401
  • 465