[erlang-questions] Parallel Shootout & a style question

Mats Cronqvist mats.cronqvist@REDACTED
Tue Sep 2 12:21:48 CEST 2008


Hynek Vychodil wrote:
> I'm not sure if it is good idea at all. If F function is very cheap 
> and result or parameter is large (copy of it is more expensive in 
> comparison to F expense) parallel version of pmap can be slower than 
> serial version even many cores is used. Developer should be able 
> control size of parallelized bunch and switch off parallel process 
> fully. For example pmap(fun(X) -> [0|X] end, [lists:seq(1,1000000)]) 
> is really bad idea and I will not be happy if lists:map will be 
> changed to pmap automatically at default ;-)
  regardless of how the OTP libs behaves, it will always be possible to 
find some case for which it performs badly. the question is what the 
*default* behavior should be.
  it seems obvious to me that the target for the OTP libs should be 
non-trivial calculations on multi-core machines. motivation;

* it's where the interesting stuff happens
* it's difficult to get right

  if you want to run trivial calculations in parallel you can easily 
write your own code.

  mats



More information about the erlang-questions mailing list