Benchmarks
Large XLSX Reading Benchmark
Reproduce the MNB PHPExcel rows-versus-array reference measurement with the included workbook and standalone CLI benchmark script.
PHP 8.1+StreamingDownloadable scriptSample workbook
Available sincev2.0.5Version guide
Download and run the benchmark#
Reproduce the reference run
Use the included 500-row workbook and run each mode in a fresh CLI process with the same nine-iteration setting.
Download benchmark scriptphp benchmark-mnb-read.php.txt large-orders.xlsx 9 rows
php benchmark-mnb-read.php.txt large-orders.xlsx 9 arrayReference output#
Mode
rows()toArray()Rows500500
Median time37.512 ms37.298 ms
Peak memory18 MiB18 MiB
Fixture22,629 bytes22,629 bytes
These are disclosed reference measurements for one environment and fixture. Use the raw JSON below when reproducing or publishing a comparison.
{
"mode": "rows",
"rows": 500,
"median_ms": 37.512,
"min_ms": 34.944,
"max_ms": 96.031,
"peak_memory_bytes": 18874368,
"php": "8.4.16",
"xmlreader": false,
"zip": false,
"file_bytes": 22629,
"iterations": 9
}{
"mode": "array",
"rows": 500,
"median_ms": 37.298,
"min_ms": 34.786,
"max_ms": 92.141,
"peak_memory_bytes": 18874368,
"php": "8.4.16",
"xmlreader": false,
"zip": false,
"file_bytes": 22629,
"iterations": 9
}Scale the test correctly#
- Generate or obtain 10k, 100k, and 1M-row fixtures rather than extrapolating from 500 rows.
- Run each method in a fresh process because peak memory is process-wide and does not reset.
- Use the same selected columns, header mapping, empty-row option, formulas, styles, and shared-string policy.
- Record cold-cache and warm-cache runs separately.
- Do not compare results across different storage devices, PHP builds, extension sets, or workbooks without saying so.
Was this guide useful?Use GitHub issues for corrections, missing examples, or unclear behavior.
Open an issue