Code :
 auto logs = new double[200];
 const num = 2;
 clock_t clk;
 double norm;
 double par;
 writeln("CPUs : ",totalCPUs );
 clk = clock();
 foreach(i, ref elem; logs) {
  elem = log(i + 1.0);
 }
 norm = clock() -clk;
 clk = clock();
 foreach(i, ref elem; taskPool.parallel(logs, 100)) {
  elem = log(i + 1.0);
 }

I get same problem. Parallel foreach, is more slower that normal
foreach. And it's same code that hace lib example that claims that
parallel foreach do it in aprox. half time in Athlon X2

Reply via email to