Get native with Cython
summary
Cython compiles Python to C/C++ producing large generated files (about 3,300 lines of C for a tiny script) and supports optional static types that convert object ops to plain C giving real speedups (benchmarks show 1.3–3× versus CPython, hand-tuned cases 4–50×, inner loops up to 100–1000×). Live demos use %cython and IPython/Jupyter cells, annotated HTML output, automatic wrapping of C functions, linking to Lua showing correct results and a 2× speed change when swapping implementations, and seamless C++ vector to Python list conversion.
AI-written summary · about
chapters (18)
- 0:00Intro
- 0:16About me
- 2:49What is Cython
- 4:35How to use Python
- 5:21Python Code Example
- 8:01Distribution
- 9:28Code portability
- 11:05Python language features
- 13:08Speed
- 15:16Static type declarations
- 16:47Talking to native code
- 18:05Python support
- 20:37Compile
- 22:10Annotation
- 25:09C functions
- 31:08C arrays
- 33:25C plus
- 37:33Conclusion
related talks
33mEasy wins with Cython: fast and multi-core
42mLift your Speed Limits with Cython
33mA low latency deepdive of Python with Cython
31mCFFI, Ctypes, Cython The Good, The Bad and The Ugly
42mMaking your code faster: Cython and parallel processing in the Jupyter Notebook
28mCython in Practice: A Deep Dive into Legacy C Integration and Debugging
01h 02mWriting Python Bindings for C++ Libraries: Easy-to-use Performance
39mPushing Cython to its Limits in Scikit-learn
