[nem-en] Re: Re: Re: language shootout: cheap-concurrency (Dmitry Ivankov)

Micky Latowicki biosap at gmail.com
Wed May 9 01:45:35 CEST 2007


On 5/8/07, Kamil Skalski <kamil.skalski at gmail.com> wrote:
> BTW, did you compare performance of Python versions with Nemerle
> versions? How does it stand against your previous implementation?
>

python cheap-concurrency.py 15000  : real 17.22, 17.07+0.02 (99%%)
csharp cheap-concurrency.exe 15000  : real 9.99, 5.44+4.52 (99%%)
nemerle cheap-concurrency.exe 15000  : real 0.68, 0.65+0.01 (98%%)

python chameneos.py 15000  : real 0.19, 0.18+0.00 (96%%)
csharp chameneos.exe 15000  : real 0.93, 0.54+0.37 (97%%)
nemerle chameneos.exe 15000  : real 0.24, 0.22+0.00 (96%%)

I imagine the reason python is beating nemerle in chameneos is because
of startup time. Python runs the startup test 0.12s faster than either
c# or nemerle, so that probably explains how it wins chameneos too -
half of Nemerle's time in chameneos is fixed overhead, whereas for
python it's only 0.02s.

As for the cheap-concurrency version that uses explicit closures, it
was about 10-20% faster - it took 0.56s on the same machine.

BTW, an earlier version defined the closures like this (instead of
using a mutable reference):

        def IncrementorThread(next) {
            co.Waiting((x)=>{
                IncrementorThread(next.put(x+1))
            })
        }

But that was 10 times slower! I attributed the slowdown to the
creation of 500n new closures (where n=15000).

Is there a way to create recursive values that aren't functions? I
think some languages allow that, does Nemerle? If not, then it's no
terrible loss - using mutable variables to create graphs with loops
works well here.



More information about the devel-en mailing list