Skip to content
Prev 1024 / 2152 Next

Question on foreach package

As per the documentation of foreach package, if I use "%dopar%" then computation happens parallaly and on the contrary for %do%", it happens?sequentially. Here, I tried both "%dopar%" and "%do%" for one of the examples given in the help page of ?foreach:
? ?user ?system elapsed?
? ?0.04 ? ?0.00 ? ?0.05?
? ?user ?system elapsed?
? ?0.05 ? ?0.00 ? ?0.05?

However?surprisingly, I did not see any improvement in the computation time. I am using windows vista with dual core CPU (I think it is dual core as when I open Task manager -> Performance, I see there are 2 windows for CPU Usage History......... I am correct that it is dual core, right?) Therefore as it is dual core, shouldn't the computation time with "%dopar%" will be half of "%do%"?

Am I missing something?

Your help will be highly appreciated.

Thanks