Benchmark Methodology
Design repeatable PHP spreadsheet benchmarks with isolated processes, fixed fixtures, disclosed versions, useful metrics, and honest interpretation.
Updated
Library neutralReproducibleCLI
Available sincev2.0.5Version guide
What you will learn
- Avoid benchmark designs that accidentally measure different work.
- Collect elapsed time, throughput, peak memory, correctness, and environment metadata.
- Publish scripts and fixture checksums alongside any comparison claim.
Control the work being measured#
| Control | Required disclosure |
|---|---|
| Package source | Exact package versions and commit/tag references. |
| Runtime | PHP version, SAPI, architecture, OPcache/JIT, and loaded extensions. |
| Hardware | CPU, memory, operating system, storage type, and container/VM limits. |
| Fixture | File checksum, bytes, sheets, rows, columns, strings, formulas, styles, images, and encryption. |
| Options | Sheet, headers, selected columns, formulas, empty rows, limits, caches, and validation. |
| Process | Fresh 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#
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.
Was this guide useful?Use GitHub issues for corrections, missing examples, or unclear behavior.
Open an issue