Skip to content
MNB PHPExcelDeveloper Guide
AI

Benchmarks

Benchmark Methodology

Design repeatable PHP spreadsheet benchmarks with isolated processes, fixed fixtures, disclosed versions, useful metrics, and honest interpretation.

Level
Intermediate
Reading time
13 min
Package
Any PHP spreadsheet library
Updated
Library neutralReproducibleCLI
Available sincev2.0.5Version guide

Control the work being measured#

ControlRequired disclosure
Package sourceExact package versions and commit/tag references.
RuntimePHP version, SAPI, architecture, OPcache/JIT, and loaded extensions.
HardwareCPU, memory, operating system, storage type, and container/VM limits.
FixtureFile checksum, bytes, sheets, rows, columns, strings, formulas, styles, images, and encryption.
OptionsSheet, headers, selected columns, formulas, empty rows, limits, caches, and validation.
ProcessFresh process per mode, warmup policy, iteration count, and median/percentile method.

Measure correctness before speed#

  • Verify both libraries return the same row count and equivalent normalized values.
  • Confirm dates, booleans, errors, formulas, merged cells, and Unicode strings where relevant.
  • Fail the benchmark when parsing or output validation fails; do not report partial work as a fast result.
  • Keep setup, read, transformation, and output costs separate when possible.

Report distributions, not one lucky run#

PHP
sort($timesMs);

$median = $timesMs[intdiv(count($timesMs), 2)];
$p95 = $timesMs[(int) floor((count($timesMs) - 1) * 0.95)];

printf("median=%.3fms p95=%.3fms\n", $median, $p95);

Use at least five measured iterations after any declared warmup. Keep raw outputs so readers can inspect variance.