On Fri, 27 Mar 2015 11:11:57 -0700 (PDT)
Barrett Brister <
barre...@gmail.com> wrote:
> Hello, I have been doing some scripting with NumPy/SciPy for awhile, but
> Cython has a reputation for being particularly fast while relatively
> straightforward to code.
>
> 1. Can you guys link me to some relevant discussions of the relative
> runtime speeds of Cython vs. Numpy vs. C code?
Basically Cython is able to achieve "C-speed", because it is actually C
or C++. Over good numpy parts you can only win the better cache usage
which can sometimes be as large as 10x. But some parts of Numpy are not
as good...
but you may also be worse than numpy if you try to implement FFT or
matrix multiplication and you end-up by compeeting with the MKL.
There is a nice chapter on the "High Performance Python" book by Micha
Gorelick & Ian Ozsvald (O'Reilly)
> 2. What would be a good tutorial book for someone who has basic level of
> Python knowledge and knows very little C, to learn Cython?
Beside Ian's book, the tutorials on Cython are a good starting point
http://docs.cython.org/src/tutorial/numpy.html
--
Jérôme Kieffer <
goo...@terre-adelie.org>