When is a compiled language like Rust beneficial for Data Scientists?
summary
Experiments compare Python baseline code to Rust extensions (via PyO3), a NumPy-crate prototype, and a Rust-backed Polars pipeline; at 5 million rows with 100 features the stock Pandas pipeline runs ~7 minutes while the Rust/Polars variants cut that into interactive time. Selective Rust is most valuable for expensive recursive or looping kernels (Rust recursive beats Numba here) while Polars alone often yields the biggest practical win. Costs include steep Rust learning, cross-compilation and a high bus factor for maintenance.
AI-written summary · about
chapters (17)
- 0:00Introduction and background
- 1:28Python dominance in data science
- 3:31Why consider Rust now
- 5:17Why Rust isn't the future
- 7:22First performance experiment
- 9:08Step changes in productivity
- 10:56Exploring Polars for data frames
- 13:02Selective component rewrites
- 15:09Comparing with Numba
- 18:41Maintenance and adoption risks
- 20:47Practical time savings debate
- 21:59Q&A session begins
- 22:21Learning insights from Rust
- 23:58Alternatives like Julia and GPUs
- 26:04Learning path for Rust and Python
- 27:49Desired Rust features in Python
- 29:13Closing remarks
