[erlang-questions] Parallel Shootout & a style question

Mats Cronqvist <>
Tue Sep 2 16:30:17 CEST 2008

Hynek Vychodil wrote:
> On Tue, Sep 2, 2008 at 12:21 PM, Mats Cronqvist 
> < <mailto:>> wrote:
>     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;
> Lists module is component of stdlibs which is OTP library/aplication 
> so I can't be agree with you. Lists is often used and lists should 
> behave nice in normal usage.

  define "normal."

> Change lists:map to anything other than current is bad. There are OTP 
> libs which could not be performace beaters as gen_server, gen_fsm and 
> other, but there are OTP libraries which should be. For example stlib! 
> I guess you forgot that stdlib is OTP library too.

  well, now that you mention it, stdlib being part of OTP does sound 
vaguely familiar.
  alas, i still think the normal case should be optimized for multicore.


More information about the erlang-questions mailing list