[Cython] class versus struct...optimization

Brian Blais bblais at gmail.com
Fri May 8 12:08:08 CEST 2009


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?  :)

		thanks,

			bb

--
Brian Blais
bblais at gmail.com
http://web.bryant.edu/~bblais

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codespeak.net/pipermail/cython-dev/attachments/20090508/9889e5e3/attachment.htm 


More information about the Cython-dev mailing list