[SciPy-User] Should one NOT start with Cython first?

Jason Moore moorepants at gmail.com
Tue Mar 10 02:41:37 EDT 2015


 Most code in a typical high level scientific projects is not CPU
intensive, so it is often best to have a mixture of Python and Cython to
maximize both development speed and performance. Most people tend to follow
the pattern: 1) write in Python 2) profile 3) rewrite slow bits in with
Cython. But that doesn't mean you have to. You can write everything in
Cython if you want. One disadvantage to that is that you loose the rapid
iterative development ability you get with pure Python. If only a small
portion of your code is Cython you can usually get by with compiling it
only occasionally as opposed to every time you make a change. One potential
reason to write it all in Cython is if you want to share binary forms of
your code instead of Python source code.


Jason
moorepants.info
+01 530-601-9791

On Mon, Mar 9, 2015 at 10:27 PM, Brian Merchant <bhmerchant at gmail.com>
wrote:

> Recently, this question was asked on stackoverflow:Cython: when using
> typed memoryviews, are Cython users supposed to implement their own library
> of “vector” functions?
> <http://stackoverflow.com/questions/28948175/cython-when-using-typed-memoryviews-are-cython-users-supposed-to-implement-the/28948871#28948871>
>
> The current answer suggests that one should not write as much of the
> program as possible using Cython. Rather, one should start with Python, and
> then only use Cython for bottlenecks.
>
> Is this the right mentality to have when using Cython for scientific
> projects? Why not start Cython first from the get-go?
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20150309/aeb1bdf1/attachment.html>


More information about the SciPy-User mailing list