On Sep 30, 2009, at 2:39 PM, William Stein wrote:

> On Wed, Sep 30, 2009 at 2:04 PM, Lisandro Dalcin  
> <[email protected]> wrote:
>> On Wed, Sep 30, 2009 at 3:43 PM, William Stein <[email protected]>  
>> wrote:
>>> On Wed, Sep 30, 2009 at 5:05 AM, Magnus Lie Hetland  
>>> <[email protected]> wrote:
>>>> One of my PhD students suggested adding Cython to the Computer
>>>> Language Benchmark Game:
>>>>
>>>>   http://shootout.alioth.debian.org/
>>>>
>>>> Seems like it would be fun -- after all, there are already Python
>>>> implementations there (for 11 problems), so as a start, one could
>>>> simply wrap up a proper compilation script for Cython, and  
>>>> submit it.
>>>> Fiddling with declarations etc. would be a natural next step, of  
>>>> course.
>>>>
>>>> I'm thinking about doing something here myself, but I'm a bit busy
>>>> with another project at the moment, so I thought I'd mention it  
>>>> here,
>>>> in case someone else felt inspired.
>>>>
>>>> I think this is a shootout many people refer to when discussing
>>>> relative performance of languages; getting Cython in there might  
>>>> peak
>>>> the interest of people who might actually need it, but who don't  
>>>> know
>>>> it exists...
>>>>
>>>> (Sorry for cross-posting -- I guess this might be relevant for both
>>>> lists.)
>>>>
>>>
>>> I've always wanted somebody to add Cython to that page, since I  
>>> think
>>> Cython should do as well as C in every benchmark... which would  
>>> be fun
>>> because C wins every benchmark.

Yes, we should do that for sure. The --embed mode makes things much  
easier. I also think we should have two implementations--a Pythonic  
one (perhaps with types, but still natural), and a maximum  
performance (essentially C).

>> Though IMHO Cython should be tested in two "modes": plain compilation
>> of py sources, and cdef-typed implementations...
>>
>
> I just did the pidigits one in about 5-10 minutes... and Robert
> Bradshaw just walked into my office and said he's already done some of
> them (they are sitting on his laptop somewhere).

Now they're up at http://hg.cython.org/shootout/file/tip Please feel  
free to expand/improve.

> http://sage.math.washington.edu/home/wstein/tmp/pidigits.pyx
>
> The timing for that one is basically the same as C.   Robert remarks
> that in some cases Python's "print/rawinput" is a serious bottleneck
> compared to C if we want to stick with idiomatic Cython.

Yep, and several of them are IO intensive. We can use printf and  
friends if we need.

- Robert

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to