Skip to content
Prev 264377 / 398502 Next

%dopar% parallel processing experiment

On 02.07.2011 19:32, ivo welch wrote:
Feedback is that a single computation within your foreach loop is so 
quick that the overhead of communicating data and results between 
processes costs more time than the actual evaluation, hence you are 
faster with a single process.

What you should do is:

write code that does, e.g., 10000 iterations within 10 other iterations 
and just do a foreach loop around the outer 10. Then you will probably 
be much faster (without testing). But this is essentially the example I 
am using for teaching to show when not to do parallel processing.....

Best,
Uwe Ligges