← All benchmarksPython
DuckDB vs Polars vs pandas on 30 million rows: 6.6 s vs 22.9 s vs 178 s
How fast is DuckDB compared with Polars and pandas on a 1.3 GB CSV?
A group-by on 30 million rows (1.3 GB CSV) took 6.6 s and 187 MB with DuckDB, 22.9 s and 522 MB with Polars, and 178 s and 568 MB with pandas on a MacBook Air.
Results
| DuckDB | 6.6 s, 187 MB RAM |
|---|---|
| Polars | 22.9 s, 522 MB RAM |
| pandas | 178 s, 568 MB RAM |
How it was measured
SUM and COUNT grouped by country and month, reading the CSV directly.
SELECT country, date_trunc('month', created_at) m, count(*), sum(amount) FROM read_csv('orders.csv') GROUP BY 1,2Why
DuckDB is a vectorized, parallel, columnar engine that streams the CSV.
When this does not apply
Synthetic data and one query; CSV date parsing dominates the Polars and pandas numbers.
Environment
MacBook Air (Apple silicon, 8 cores), macOS. Measured 2026-10-12.
Source: shorts/demo-ticket/cost in my content-engine repository. Treat any single run as a direction; re-run it on your hardware.
Related
By Josué Barros, senior software engineer (full-stack, data and AI).