This project includes practical, workload-driven benchmark checks comparing:
polars_readstatv0.17.0pandaspyreadstat(usingread_file_multiprocessingfor parallel reads)
These are intended as reproducible engineering checks, not formal microbenchmarks.
- CPU: AMD Ryzen 7 8845HS (16 cores)
- RAM: 14 GiB
- OS: Linux Mint 22
- Storage: external SSD
- Last run date: May 14, 2026
- Timing method: Python
time.time()wall-clock timing
Each benchmark compares four scenarios:
- Full file load
- Column subset
- Row filter
- Column subset + row filter
-
Stata (
.dta)- Source: IPUMS 2000 5% sample decennial census
- Rows: 10,000,000 (capped to fit laptop memory)
- Shape: relatively tall and narrow
-
SAS (
.sas7bdat)- Source: ACS 5-year Illinois PUMS
- Rows: 623,757
- Shape: shorter and wider
-
SPSS (
.sav)- Source: American National Election Studies (ANES) cumulative time-series
- Rows: 73,745
- Columns: 1,030
- File size: ~87 MB
-
zsav (
.zsav)- Source: ACS 5-year Illinois PUMS (same data as SAS above, SPSS compressed format)
- Rows: 623,757
- Note: pyreadstat excluded — exhausts RAM on this file
- Results can vary by machine, disk speed, CPU scaling, and library versions.
- For reruns, use the helper scripts in
scripts/and tests intests/.
all times in seconds (speedup relative to pandas in parenthesis below each)
| Library | Full File | Subset: True | Filter: True | Subset: True, Filter: True |
|---|---|---|---|---|
| polars_readstat | 0.55 (3.9×) |
0.07 (28.4×) |
1.46 (2.0×) |
0.08 (39.4×) |
| pandas | 2.16 | 1.99 | 2.93 | 3.15 |
| pyreadstat | 6.76 (0.3×) |
1.64 (1.2×) |
7.86 (0.4×) |
2.18 (1.4×) |
all times in seconds (speedup relative to pandas in parenthesis below each)
| Library | Full File | Subset: True | Filter: True | Subset: True, Filter: True |
|---|---|---|---|---|
| polars_readstat | 0.16 (7.3×) |
0.10 (11.7×) |
0.18 (7.3×) |
0.09 (13.8×) |
| pandas | 1.17 | 1.17 | 1.31 | 1.24 |
| pyreadstat | 5.48 (0.2×) |
4.57 (0.3×) |
5.67 (0.2×) |
7.69 (0.2×) |
all times in seconds (speedup relative to pandas in parenthesis below each)
| Library | Full File | Subset: True | Filter: True | Subset: True, Filter: True |
|---|---|---|---|---|
| polars_readstat | 1.09 (62.5×) |
0.15 (3.9×) |
1.10 (62.4×) |
0.15 (3.9×) |
| pandas | 68.12 | 0.59 | 68.67 | 0.59 |
| pyreadstat | 3.06 (22.3×) |
1.15 (0.5×) |
7.09 (9.7×) |
1.23 (0.5×) |
all times in seconds (speedup relative to pandas in parenthesis below each)
| Library | Full File | Subset: True | Filter: True | Subset: True, Filter: True |
|---|---|---|---|---|
| polars_readstat | 3.97 (5.9×) |
1.04 (2.1×) |
4.77 (4.7×) |
1.15 (2.0×) |
| pandas | 23.47 | 2.20 | 22.40 | 2.29 |