Easy wins with Cython: fast and multi-core
summary
Cython compiles .pyx to C then to a binary and adding static types turns dynamic loops into native code, demonstrated on a tax calculator over 10 million incomes. Pure Python run is about 12s, a typed Cython inner loop drops to 50 ms, and splitting work with Python 3 ThreadPoolExecutor plus with nogil threaded sections yields ~92% efficiency on four cores — the prototype actually runs and scales near linearly.
AI-written summary · about
chapters (6)
related talks
33mA low latency deepdive of Python with Cython
42mLift your Speed Limits with Cython
40mGet native with Cython
42mMaking your code faster: Cython and parallel processing in the Jupyter Notebook
31mCFFI, Ctypes, Cython The Good, The Bad and The Ugly
22mExperiences making CPU-bound tasks run much faster
33mWhy is Python slow?
57mPython and PyPy performance (not) for dummies
