Pumping up Python modules using Rust
summary
Claim: Rust lets Python gain memory-safe, ahead-of-time speed by compiling extensions into dynamic libraries and calling them over a C ABI. Examples: a string-duplicate benchmark shows ~25× and ~10× speedups; companies like Sentry and Wire move hot paths to Rust and cut processing time. Tools actually used: cargo, rayon for data parallelism, the rust cpython crate and platform FFI rules; built a .so extension, bench tested it, and it works — but cross-language calls have measurable overhead so keep them coarse-grained.
AI-written summary · about
chapters (17)
- 0:00Start
- 3:06Need for native extension
- 4:28Native extension aren't new to Python devs
- 13:45Flow control
- 14:08Looping
- 15:03Garbage Collection
- 15:36Referencing
- 16:31Same implementation in Rust
- 17:01Borrowing
- 17:34High-level iterators
- 18:39Struct can have methods
- 19:15How does this work?
- 20:23Rust FFI capabilities
- 21:14Interfacing & building the python module
- 22:29Rust-Cpython: Integration
- 24:59When should you use Rust?
- 25:46What does Rust have to offer?
related talks
36mPumping up Python modules using Rust
34mRust for the Python dev
31mCan Rust make Python shine?
46mPython + Rust = ?
46mHot paths: using Rust libraries in Python
29mThe Art of Extending Python with other languages
44mHow Python Harnesses Rust through PyO3
40mNine Rules for Writing Python Extensions in Rust
