Jump to ratings and reviews
Rate this book

Cython: A Guide for Python Programmers

Rate this book
Cython can yield massive performance improvements over pure Python--speedups of 3000X are easily attainable for certain patterns. With this book, Kurt Smith shows you how to use Cython to easily wrap C and C++ libraries in Python, handling all the details of memory management for you. By removing the barrier between Python and C, Cython harnesses the best of both languages while remaining familiar and comfortable to Python users.Cython has proven its usefulness in many foundational Pandas, SymPy, Sage, and dozens of others, both open and closed source. You'll learn how Cython is an essential part of any performance-oriented Python programmer's arsenal.

Paperback

First published December 25, 2014

37 people are currently reading
83 people want to read

About the author

Kurt W Smith

2 books1 follower

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
17 (34%)
4 stars
22 (44%)
3 stars
10 (20%)
2 stars
0 (0%)
1 star
1 (2%)
Displaying 1 - 5 of 5 reviews
Profile Image for Serdar.
Author 13 books38 followers
January 7, 2017
My browser just ate the entire original version of this review because I'm a klutz. But here's the short version.

- Python is slow. C is fast.
- Programming in Python is easy. Programming in C is hard.
- Cython bridges the gap. Write Python, convert it to C incrementally.
- This book does a great job of walking you through the process and teaching you how to get the most out of one of the best things to happen to Python since Guido van Rossum himself.
- It's aimed mainly at number-crunchers -- lots of focus on integration with Numpy -- but the motivated programmer can easily see how to apply it to many other fields. (In my case, I wrote a video game and got massive speedups by moving performance-crucial code to C with Cython, mainly the collision detection algorithms.)
- Not a long book, but that adds to its accessibility.
- Anyone remotely interested in enhancing Python performance where it's warranted* deserves to pick this up.

* Python's big appeal is that it swaps programmer convenience for raw performance. A script thrown together in ten minutes that takes two minutes to run will always beat a program that takes two days to put together but executes in a tenth of a second. But with Cython, we're reaching a point where we don't have to compromise.
Profile Image for Douglas Baldwin.
1 review
March 16, 2015
Kurt Smith's Cython is very clear. With only a few days of reading and coding, I was able to speed up my pure-Python simulation from 6 s per iteration to just 30 ms! If you're simulating physics in Python on a workstation, I highly recommend this book.
13 reviews1 follower
March 17, 2018
Really nice if you want to get familiar with lower-level implementation with Python, especially for scientific computing.
I enjoyed the sections on typed memoryviews and OpenMP (prange) + concrete examples with speedups measure.
114 reviews1 follower
May 10, 2023
Very dense. More reference than textbook. A couple of good worked examples.
Displaying 1 - 5 of 5 reviews

Can't find what you're looking for?

Get help and learn more about the design.