Python can be compiled to run much faster with relatively little effort. You'll learn how to make your code run a C-like speeds using three major technologies, each requiring varying degrees of effort. This course is for Intermediate Pythonistas who want to learn about profiling, Cython, Numba, Pythran and PyPy. First we'll recap line_profiler and memory_profiler (this will complement Yury's talk using a different code example) to identify slow code segments.
Next we'll learn to use Cython on a plain Python problem to achieve a very respectable C-like solution. We'll extend this to use numpy which will enable OpenMP multi-core parallelism.
We'll also use Continuum's Numba as a Just in Time compiler, showing how we can get great speed-ups for very little effort.
Finally we'll review Pythran and PyPy to see how two other tools let us achieve similar speed-ups and reviewing the different directions these tools are driving in.
By the end of the session you'll be able to identify bottlenecks in your code and you'll have 3 approaches to making them run at up to C-like speeds.
REQUIREMENTS: This tutorial will be hands-on, you'll need a recent Anaconda installation. To take part in the profiling exercises you should also install line_profiler and memory_profiler and pillow. Code samples will be handed out on a USB stick at the start of the class. You'll find these modules at: https://pypi.python.org/pypi/line_profiler/ https://pypi.python.org/pypi/memory_profiler https://pypi.python.org/pypi/Pillow/2.4.0