Gabriel Gellner wrote:
> On Tue, Nov 25, 2008 at 10:05:22AM -0500, Gabriel Gellner wrote:
>   
>> So I am giving a talk to my lab about doing some fast ODE solving using
>> python. Traditionally I have used f2py to define the callback function, but I
>> think Cython is a better fit for some of the newer students that don't know
>> fortran (though in this case it is easy to teach them).
>>
>> Now using the cython/numpy tutorial I can get my code to run around 50% 
>> slower
>> than the f2py generated code (which is still a healthy order of magnitude
>> faster than the python callback . . .). If  there are any easy things I can 
>> do
>> to make the code faster (without sacrificing readability) I would be very
>> grateful!
>>
>>     
> So I made some code that uses the Numpy C-api for the call to empty and now
> the Cython code runs faster (or as fast) as the f2py! Joy. I will be getting
> it to the point that I can give a patch to numpy.pxd soon.
>
> Thanks for all the comments and help.
>   
That's great news! I saw your post on numpy-discuss -- what what the 
solution?/why did it crash? I couldn't figure it out either...

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

Reply via email to