Switch language한국어
Back to the list

I Rewrote python-dateutil in Rust — Even a Naive Port Is Up to 94x Faster

TL;DR AI

Key summary

2 min read
  1. python-dateutil-rs is a Rust-backed drop-in replacement for python-dateutil that you can install with pip.

  2. The project is a near line-by-line Rust port using PyO3 and passes the original ~13,000-line test suite.

  3. Benchmarks on Apple Silicon M3 (Python 3.13, Rust 1.86) show module speedups from 1.7x to 94.3x, with ISO parsing up to 23.5x faster.

  4. The 94.3x timezone speedup comes from a Rust-side RwLock<HashMap> cache; individual timezone ops still improve without the cache.

Read the original