phpolars
Benchmarks
phpolars and py-polars
phpolars and py-polars both run Polars' Rust engine. phpolars embeds the Rust crate at version 0.55.2, built with Cargo's release profile; py-polars ships its own build of the engine. The data are a 1M-row CSV (k: 100,000 keys, g: 50 groups, x: integers with 2% missing, y: floats; 22 MB) and a 100,000-row lookup table on k. Each case runs once to warm up and then five times; the value is the median. Both use 2 Polars threads (phpolars' default php_polars.max_threads), py-polars 1.43.2 on Python 3.14.7. Results stay in Polars; converting them to PHP arrays is not timed.
Apple M5 Ultra · PHP 8.5.10 · recorded 2026-10-17 · commit d73bba4
| Case | phpolars | py-polars |
|---|---|---|
| Read a 1M-row CSV | 36.0 | 23.1 |
| Group 1M rows by 50 keys: mean, sum, count | 9.62 | 12.3 |
| Inner join 1M rows with a 100k-row table | 13.9 | 16.4 |
Wall time, in ms. Values without a measurement are left out of the chart.
phpolars and plain PHP arrays
Plain PHP arrays are the baseline that a PHP data frame library starts from. The data are a 1M-row CSV (k: 100,000 keys, g: 50 groups, x: integers with 2% missing, y: floats; 22 MB) and a 100,000-row lookup table on k. Each case runs once to warm up and then five times; the value is the median. The plain PHP code reads rows with fgetcsv, groups with one loop over an associative array, and joins with a hash index of the lookup table. phpolars uses 2 Polars threads. Results stay in Polars; converting them to PHP arrays is not timed.
Apple M5 Ultra · PHP 8.5.10 · recorded 2026-10-17 · commit d73bba4
| Case | phpolars | plain PHP arrays |
|---|---|---|
| Read a 1M-row CSV | 36.0 | 440 |
| Group 1M rows by 50 keys: mean, sum, count | 9.62 | 52.8 |
| Inner join 1M rows with a 100k-row table | 13.9 | 310 |
Wall time, in ms. Values without a measurement are left out of the chart.