MNB PHPExcelDeveloper Guide
Benchmarks

Large XLSX Reading Benchmark

Reproduce the MNB PHPExcel rows-versus-array reference measurement with the included workbook and standalone CLI benchmark script.

Updated

PHP 8.1+StreamingDownloadable scriptSample workbook
Available sincev2.0.5Version guide
LevelIntermediateReading time12 minPackagemnb/mnb-phpexcel

What you will learn

  • Run each reading mode in a fresh PHP process.
  • Capture median elapsed time, peak allocated memory, rows, file bytes, and environment details.
  • Publish results with enough context for another developer to reproduce them.

Download and run the benchmark#

Download benchmark-mnb-read.php

Terminal
php benchmark-mnb-read.php.txt large-orders.xlsx 9 rows
php benchmark-mnb-read.php.txt large-orders.xlsx 9 array

Reference output#

rows-result.json
{
  "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
}

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.