Making your code faster: Cython and parallel processing in the Jupyter Notebook
summary
Benchmarks run inside a Jupyter Notebook compare plain Python, NumPy, Cython, SciPy integrators, Numba and IPyParallel on an Euler approximation of y=x² over a million points. Plain Python takes ~10 s, Cython ~6 s, NumPy about ~3.5 s, SciPy ~9.7 s, while Numba 471 ms cuts runtime by an order of magnitude. IPyParallel halves some runs to ~5.8 s and combining IPyParallel with Numba yields ~1.2 s, showing which tools and numbers actually move the needle.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:49Problem statement
- 5:40Jupyter Notebook demo setup
- 8:27Baseline Python performance
- 9:10Cython optimization in Jupyter
- 12:24NumPy arrays for speed
- 15:56Differential equations with SciPy
- 21:37Numba introduction
- 24:30Numba for Euler method
- 27:25Parallel processing with IPython
- 30:18Task distribution across cores
- 36:23Numba + parallel processing
- 37:27Recommendations
related talks
33mEasy wins with Cython: fast and multi-core
37mAccelerating Scientific Computing in Python with Numba: A Real-World Example
22mSupercharge Scientific Computing in Python with Numba
26mYour Escape Plan From Numpy + Cython
33mA low latency deepdive of Python with Cython
37mUsing Numba Effectively Today
33mWhy is Python slow?
40mGet native with Cython
