Cython: Runtime and tutorial books

31 views
Skip to first unread message

Barrett Brister

unread,
Mar 27, 2015, 2:55:07 PM3/27/15
to cython...@googlegroups.com
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?

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?

Thanks,

Barrett

Jérôme Kieffer

unread,
Mar 27, 2015, 4:46:40 PM3/27/15
to cython...@googlegroups.com
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>

Hai Nguyen

unread,
Mar 27, 2015, 6:11:28 PM3/27/15
to cython-users
You can check my github channel to see the growing collection here.


Per Cython book for beginner, you can check Cython website's tutorials for the info.

If you are really want to know deeper about Cython (and how great it is), you should definitely read "Cython" book

It's well written with lots of clear examples. The author understands Cython well. 

Hai

--

---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages