From Belderbos · Bob Belderbos · · 3m
TL;DR: How Rust rides inside Python
A tiny JSON parser in Rust shows where PyO3 ports actually get slow, and it is not the parsing.
When you port Rust into Python, profile the boundary. Building Python objects on the way out can cost more than the algorithm itself. A tiny JSON parser in Rust shows where PyO3 ports actually get slow, and it is not the parsing. Every Pydantic v2 validation call hands the work to a Rust extension.
- You already run Rust
- A parser small enough to read
- Four steps to import
- Macros are the wiring
Read the story version — the same reporting as a swipeable deck of 12 cards.






