On May 8, 2009, at 3:08 AM, Brian Blais wrote: > On May 7, 2009, at 20:42 , Lisandro Dalcin wrote: > >> Brian, in the Cython version, class Neuron, do this: instead of "def >> update(...)", please write "cpdef update(...)" and time your code >> again. If this make it faster (it should be near the C-struct >> version), please consider first removing your original "def update", >> and replace your "cdef _update()" by "cpdef update()". >> > > thanks, but this didn't change the time much at all (something > like .5 ms out of 20ms). I was following the example in the cython > docs Early Binding for Speed section, but now I see it got updated > to cpdef! > > I'll keep hacking away at it. Perhaps I'll try a smaller example, > to see the difference between lookups in classes and in structs, if > that really is the issue. > > Is there a better way to find speed bottlenecks than the "comment > out and re-compile" method? :)
That's of course the only sure way to do it... Try compiling with "cython -a" and then opening up the resulting .html file. Yellow means Python/C API calls, which are often an indication of unintended inefficiencies. - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
