Polars vs the next-fastest engine

Polars total time against the next-fastest engine at each data size

10 GB · 16 vCPUs: 1.33× faster

100 GB · 16 vCPUs: 1.22× faster

100 GB · 192 vCPUs: 1.77× faster

1 TB · Polars Nanook 0.13: 1.36× faster

The benchmark

Built on industry-standard benchmarks

PDS-H is based on TPC-H, the standard benchmark for analytical databases. Its 22 queries filter, join and aggregate the sales data of a wholesale supplier. PDS-DS is based on TPC-DS and has 99 more complex queries on the data of a retailer. The scale factor (SF) sets the size of the data.

SF10

10 GB

About 10 GB of data as uncompressed CSV. We ran PDS-H at this size on a single machine.

SF100

100 GB

About 100 GB of data as uncompressed CSV. We ran PDS-H and PDS-DS at this size on a single machine.

SF1000

1 TB

About 1 TB of data as uncompressed CSV. We ran PDS-H at this size on a cluster of 32 machines.

Single node
Polars

The fastest engine on a single machine

We ran open-source Polars 2.0, DuckDB 2.0 and DataFusion 54 on the same AWS machine, with 16 vCPUs and 32 GB of memory. Polars was the fastest on every benchmark. On a larger machine with 192 vCPUs, Polars was 1.77× faster than the next engine on PDS-H at 100 GB.

PDS-H at 10 GB

SF10 · 16 vCPUs, 32 GB · 22 queries, lower is better

  • Polars 2.0
    3.22 s
  • DuckDB 2.0
    4.27 s
  • DataFusion 54
    7.41 s

PDS-H at 100 GB

SF100 · 16 vCPUs, 32 GB · 21 queries, lower is better · Q18 excluded, DataFusion ran out of memory

  • Polars 2.0
    34.63 s
  • DuckDB 2.0
    42.12 s
  • DataFusion 54
    78.04 s

PDS-DS at 100 GB

SF100 · 16 vCPUs, 32 GB · 97 queries, lower is better · Q67 and Q72 excluded, DataFusion timed out

  • Polars 2.0
    85.83 s
  • DuckDB 2.0
    98.59 s
  • DataFusion 54
    198.48 s
Distributed engine
Polars Nanook

When the data outgrows one machine

Polars Distributed runs each query across your cluster to handle terabytes of data. It is available in Polars Nanook. We ran PDS-H at 1 TB with Polars Nanook 0.13, PySpark, Trino and Databricks, each on the same cluster of 32 AWS machines. On the 19 queries all four finished, Polars Nanook was 5.48× faster than PySpark, 3.77× faster than Trino and 1.36× faster than Databricks.

PDS-H at 1 TB

SF1000 · 32 × m8i.xlarge · 19 queries, lower is better · Q8, Q9 and Q21 excluded, Trino ran out of memory

  • Polars Nanook 0.13
    149.61 s
  • Databricks 19
    203.84 s
  • Trino 484
    564.28 s
  • PySpark 4.0.1
    820.36 s
Method

How we ran it

How we timed

At 10 and 100 GB, every query ran five times on a warm machine, each time in its own process with a 60-second timeout, and the fastest run counts. At 1 TB, PySpark / Trino / Nanook times are the fastest of three runs to avoid network stragglers skewing the results; Databricks times are from a single run.

Hardware

At 10 and 100 GB every engine ran on the same AWS c7a machines, reading Parquet from EBS. At 1 TB, every engine ran on the same 32 m8i.xlarge workers, reading from S3.

Out of memory

Some engines ran out of memory on some queries, so they could not finish the full benchmark. To still compare them, we gave those engines the benefit of the doubt and left those queries out for every engine, so each total covers the same work. The caption above each chart names the queries that were left out and why.

Run it yourself

The data generator settings, the queries and the run scripts are public, so you can repeat every run on your own hardware.

FAQs

Frequently asked questions

On a 32-node cluster at 1 TB, PySpark 4.0.1 took 5.48× as long as Polars Nanook 0.13 to run the 19 PDS-H queries every engine finished.