Reddit Reddit reviews High Performance Python: Practical Performant Programming for Humans

We found 2 Reddit comments about High Performance Python: Practical Performant Programming for Humans. Here are the top ones, ranked by their Reddit score.

Computers & Technology
Books
Computer Programming
Programming Algorithms
High Performance Python: Practical Performant Programming for Humans
Check price on Amazon

2 Reddit comments about High Performance Python: Practical Performant Programming for Humans:

u/BulkyProcedure · 3 pointsr/learnpython

I just recently discovered pythonbooks.org and it looks like a pretty good resource for books on Python, and it has categories for beginner, intermediate, and more specific topics.

Here's pythonbooks.org page on networking.

Here's a link to High Performance Python (chapter on concurrency w/multiprocessing)

u/orichalcum · 2 pointsr/Python

I've only used cython a couple times but my experience was fantastic.

In the first case I had a simulator that was spending most of its time calculating distances between points and the nearest lines. I knew my algorithm was good, but profiling showed that the bare arithmetic was enough to make my code unacceptably slow.

Just extracting this function to a .pyx file and setting up the build correctly got me a 5x speedup. Then I added typedefs for the ints and floats and got an additional 10x speedup.

After crowing about this to a colleague she wanted to use cython to speed up a slow loop in some data analysis code. Again we got 5x just for putting the slow part in a .pyx file. There was a little more effort here figuring out how to correctly declare numpy arrays, but after that she also saw a roughly 10x additional speedup.

In both cases there was some necessary upfront work of profiling the code and refactoring to isolate the computationally intensive part. But if this is straightforward, cython can be a very quick win.

I recommend the book High Performance Python

http://www.amazon.com/High-Performance-Python-Performant-Programming/dp/1449361595/ref=sr_1_1?ie=UTF8&qid=1425266485&sr=8-1&keywords=high+performance+python

which taught me a lot about profiling, cython, and other tools for speeding up Python code.