Lift your Speed Limits with Cython
summary
Shows Cython compiling ordinary Python into C, adding typed C doubles and buffer access to drop object overhead, disabling bounds checks and releasing the GIL for OpenMP loops. Uses numpy arrays and C APIs, shows annotated source and generated C. Measured runs: pure Python ~3s, numpy vectorized ~58ms, compiled+typing ~30ms then ~10ms after indexing optimizations — up to ~300× speedup on the tax-rate example and working code throughout.
AI-written summary · about
chapters (10)
- 0:00Start
- 5:55Demo
- 11:20Own Wrapper Functions
- 18:58Log Normal Distribution
- 19:23The Tax Calculation Formula
- 20:52Average Tax Rate
- 22:10Optimize this Code
- 22:55Umpire Slicing
- 26:44C Optimizations
- 29:16Python Function into a Static C Function
related talks
33mA low latency deepdive of Python with Cython
33mEasy wins with Cython: fast and multi-core
40mGet native with Cython
39mPushing Cython to its Limits in Scikit-learn
01h 21mAccelerating Python With C++
01h 02mWriting Python Bindings for C++ Libraries: Easy-to-use Performance
31mCFFI, Ctypes, Cython The Good, The Bad and The Ugly
25m"Boosting Python Numeric Computations with Dynamic C++ Integration"
