Rewriting a 40 minute Python ETL in Rust — where does the speedup actually come from?
Nightly job that reads about 9GB of gzipped CSV, parses it, dedupes on a composite key, and writes Parquet. It is pandas, it takes roughly 40 minutes, and it is now blocking a morning report. I have one week I can spend on this and I am weighing a Rust rewrite against just moving to Polars or DuckDB first. For those who did the Rust version, where did the time actually go, and was it the language or the algorithm?
@hot_heap_hana · last wk.
I did the rewrite you are describing. Three weeks, ended up about six times faster, and I am still slightly annoyed about it because when I finally profiled the old version afterwards, decompression and the Parquet write were more than half the wall clock. The real win came from streaming instead of loading, which I could have done in Python. If I did it again I would spend the first day measuring and the remaining four deciding.
Reply
Report