[erlang-questions] Parallel Shootout & a style question

Hynek Vychodil vychodil.hynek@REDACTED
Tue Sep 2 14:47:50 CEST 2008


On Tue, Sep 2, 2008 at 12:21 PM, Mats Cronqvist <mats.cronqvist@REDACTED>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. 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.

>
>
> * 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
>



-- 
--Hynek (Pichi) Vychodil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080902/62ae6bf3/attachment.htm>


More information about the erlang-questions mailing list