Specializing dynamic language C extensions using type information
summary
Introduces typed methods metadata for C extension functions so a runtime can call them with unboxed C types instead of boxing to PyObject, implemented as a PyPy prototype that reads a meth_typed flag and treats arguments as C long* (or other C types). A tight microbenchmark (a billion increments) drops from ~160s to ~2s (≈60×); change is opt-in, backward‑compatible, small (~60 lines), and integrates with Cython to auto-generate annotations.
AI-written summary · about
chapters (10)
- 0:00Dynamic language C extensions
- 1:27Python C API limitations
- 3:38PiPie's C extension challenges
- 5:26C API argument parsing overhead
- 7:55Adding type info to C extensions
- 9:03Optimizing C calls with types
- 10:09Microbenchmark performance gains
- 11:31Impact on other Python runtimes
- 12:33Key takeaways and future work
- 13:58Q&A
related talks
33mA low latency deepdive of Python with Cython
28mMind the gap! Why static typing requires more than just adding annotations
42mLift your Speed Limits with Cython
03h 40mTyping
15mExtending Python Into the Future
32mStatic Typing in Python
22mPyPy and the future of the Python ecosystem
23mmypy Python's gradual typing implementation
