This repository contains the code from "High Performance Python" by Micha Gorelick and Ian Ozsvald with O'Reilly Media. Each directory contains the examples from the chapter in addition to other interesting code on the subject.
This book ranges in topic from native Python to external modules to writing your own modules. Code is shown to run on one CPU, multiple coroutines, multiple CPU's and multiple computers. In addition, throughout this exploration a focus is kept on keeping development time fast and learning from profiling output in order to direct optimizations.
The following topics are covered in the code repo:
Chapter 1: Profiling
Chapter 2: Understanding Performant Programming
Chapter 3: Lists and Tuples
Chapter 4: Dictionaries and Sets
Chapter 5: Iterators
Chapter 6: Matrix and Vector Computation
Chapter 7: Compiling to C
Chapter 8: Concurrency
Chapter 9: Multiprocessing
Chapter 10: Clusters and Job Queues
Chapter 11: Using Less Ram
Chapter 12: Lessons from the Field (no code)
This code base is a live document and should be freely commented on and used. It is distributed with a license that amounts to: don't use the code for profit, however read the provided license file for the law-jargon. Feel free to share, fork and comment on the code!
If any errors are found, or you have a bone to pick with how we go about doing things, leave an issue on this repo! Just keep in mind that all code was written for educational purposes and sometimes this means favouring readability over "the right thing" (although in Python these two things are generally one and the same!).