Pumping up Python modules using Rust
summary
Shows how replacing hot Python paths with Rust extensions yields concrete gains: a string word‑count example gives about 10x speedup when rewritten in Rust and exposed via PyO3 (or rust-cpython) using the C ABI; parallelizing that loop with rayon converts an iterator into safe data-parallel work. Covers tooling (cargo, rustup, rustfmt), FFI via C ABI, ownership and borrowing for zero‑cost memory safety, and real cases (Wire, Sentry, Firefox) that saw clear production improvements.
AI-written summary · about
chapters (19)
- 0:00Introduction to talk
- 1:26Identifying Python bottlenecks
- 2:30Why use native extensions
- 5:41Challenges with C++
- 8:55Why Rust for Python
- 10:19Real-world Rust success stories
- 13:48Rust in Firefox browser
- 14:30Rust syntax basics
- 18:27Memory safety in Rust
- 22:39Custom data types in Rust
- 24:04Generics and iterators
- 25:47Parallelism with Rayon
- 26:30Foreign Function Interface
- 29:58Building Rust-Python modules
- 31:21Benchmarking Rust vs Python
- 32:51Rust tooling overview
- 33:36When to use Rust in Python
- 34:40Rust as modern C++ alternative
- 35:22Q&A
related talks
31mPumping up Python modules using Rust
34mRust for the Python dev
46mPython + Rust = ?
44mHow Python Harnesses Rust through PyO3
44mDo Pythons Rust? How we used PyO3 to build a Python Stream Processor w/ a Rust Heart
35mUsing Rust to write Python modules
21mExtending the horizons of R with Rust
57mTechniques learned from five years finding the way for Rust in Python
