ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

William Dode wilk at flibuste.net
Mon Jul 27 13:16:15 CEST 2009


On 27-07-2009, Bearophile wrote:
> William Dode':
>> I updated the script (python, c and java) with your unrolled version
>> + somes litle thinks.
> [...]
>> c 1.85s
>> gcj 2.15s
>> java 2.8s
>> python2.5 + psyco 3.1s
>> unladen-2009Q2 145s (2m45)
>> python2.5 254s (4m14s)
>> python3.1 300s (5m)
>> ironpython1.1.1 680s (11m20)
>
> Sorry for being late, I was away.
>
> In your last C version this code is useless because the C compiler is
> able to perform such simple optimization by itself (but probably
> Python isn't able, so if you want the code to be the similar in all
> versions it may be better to keep it):

I wanted so, specialy if it doesn't change a lot of the result (the 
difference is so small that i cannot see it)...

...

> I have tried your latest C version using your compiler options, my
> MinGW based on GCC 4.3.2 produces a crash at runtime.

Maybe because of -msse2 ?

> Using LLVM-GCC
> it runs in 1.31 seconds. The D version is a bit less optimized than
> your last C versions, yet using DMD it runs in 1.08-1.10 seconds.
> Let's see if someone is able to write a C version faster than that D
> code :-)
>
> Have you have compiled/read my D version? In the D version you may
> have missed that I did use an extra trick: unsigned integers, so it
> needs just two tests to see if a number is in the 0-5, 0-5 square :-)

I didn't see, fine ! But the difference is also too small to see...

> Note that Pyd, the Python-D bridge, may work with the latest DMD
> version still (and it works if you use a bit older DMD compiler):
> http://pyd.dsource.org/

I completly don't know anything about D... When i see the result of 
psyco or shedskin, i'm affraid i'll not look somewhere else soon !

However, i'd like to see a lisp implementation of this...

bye

-- 
William Dodé - http://flibuste.net
Informaticien Indépendant



More information about the Python-list mailing list