HeadlinesBriefing HeadlinesBriefing.com

DuckDB 2.0 vs Polars 2.0 Speed Test 100M Rows

Towards Data Science •
×

Three years after a version tie, DuckDB 2.0 and Polars 2.0 face off on datasets up to 335 million records. DuckDB claims version 2.0 is 6x faster than 1.56 on the TPC-H SF300 dataset. Conversely, Polars 2.0 outperforms both DuckDB versions in most benchmarks.

The comparison spans five real-world tests, including a 167-second versus 11-second race reading 100 million Postgres rows. Other tests cover writing to Postgres, processing local CSVs, and reading/writing Parquet data from AWS S3. The libraries differ fundamentally: DuckDB is an embedded analytical database using SQL, while Polars is a Rust-written Data Frame library now adding SQL as a first-class citizen in version 2.0.

Testing occurred on a Windows PC with an Intel Core i9-13900K, 32 threads, and 64GB RAM. Each test ran in a Jupyter Notebook with full restarts between runs. Prerequisites include a local Postgres database and AWS S3 access.

The results highlight a significant performance gap, with DuckDB winning on large-scale Postgres reads and Polars excelling in other areas, reflecting their distinct design philosophies for data processing.

Source: Towards Data Science · Summarized by HeadlinesBriefing