>>> A future optimization would be the @cython.boundscheck(False) directive.
>>
>> Do you mean future as in "don't try to use it now" or "should use it
>> if it's safe to proceed without boundary checking"?  Also, this looks
>> like a decorator to me, but I couldn't compile when I put it in front
>> of my function definition.
>
> Did you import cython?

You'd think I could catch something like that.... from now on, coffee
before code.


> 10^4 still isn't a huge array, but I would be curious how much a speed
> increase you could get without unrolling all your loops (i.e. a minimal
> modification to your code). Might be 1.6, might not be.

I've now rewritten the cython code so that it is identical to the
fortran,  and now cython is ~10% slower than fortran but much
cleaner-looking.  Thanks.

> This is due to the fact that the array processing happens at near the same
> speed, so as the array gets larger, the (relative) significance of the
> Python function call overhead goes away.

That makes sense; the python overhead is increasing proportional to n
and the overall execution time proportional to n^2.

Thanks everyone, I think I now understand cython well enough to make
some code without help next time.  I was slow to figure out that
cython really is c/fortran loop-style coding with python syntax.

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

Reply via email to