YiiPress uses PHPBench to track performance regressions.
Generate 10,000 small test entries (default):
make bench-generateGenerate 1,000 realistic entries (~27KB each, with links, images, tables, styled text):
make bench-generate-realisticCustom entry count:
make bench-generate 5000Generated data is stored in benchmarks/data/ and is gitignored.
Run all benchmarks:
make benchRun a specific benchmark class:
BENCH_FILTER=LargeContentBuildBench make benchProfile the public build command with Xdebug:
make profile-build CLI_ARGS='build --content-dir=benchmarks/data/content --output-dir=runtime/profile-output --workers=1 --no-cache'Print build phase timings without Xdebug:
make yii CLI_ARGS='build --content-dir=benchmarks/data/content --output-dir=runtime/profile-output --workers=4 --no-cache --profile'Render the full build path without writing site output files:
make yii CLI_ARGS='build --content-dir=benchmarks/data/content --output-dir=runtime/profile-output --workers=4 --no-cache --no-write --profile'Use --profile for quick before/after checks while optimizing. Use make profile-build when call-level attribution is needed.
Use --no-write to separate render/template/processor cost from output directory and file writing cost.
ContentParserBench— measures parsing speed for site config, navigation, collections, authors, and entries (with and without body loading)MarkdownRendererBench— measures MD4C markdown-to-HTML rendering for short and long documentsSyntaxHighlighterBench— measures the reusable highlighter package path for plain HTML, raw code, a single highlighted block, and a page with many highlighted blocksAssetFingerprintingBench— measures fingerprint lookup and HTML asset URL rewritingBuildProfileBench— measures overhead of disabled and enabled build phase timersOEmbedProcessorBench— measures standalone URL-to-embed expansion across pluggable oEmbed providersSmallSiteBuildBench— measures the publicyii buildcommand end to end on 10k small entries, including full rebuilds, no-write renders, and incremental rebuildsLargeContentBuildBench— measures the publicyii buildcommand end to end on 1k realistic entries (~27KB each), including full rebuilds, no-write renders, and incremental rebuilds
| Benchmark | Time |
|---|---|
| Full rebuild, sequential | ~3.438s |
| Full rebuild, 4 workers | ~2.830s |
| Incremental rebuild, no changes | ~357.636ms |
| Incremental rebuild, 1 changed entry | ~357.465ms |
| Benchmark | Time |
|---|---|
| Full rebuild, sequential | ~2.016s |
| Full rebuild, 4 workers | ~1.068s |
| Incremental rebuild, no changes | ~107.945ms |
| Incremental rebuild, 1 changed entry | ~108.596ms |
These end-to-end benchmarks intentionally go through the public CLI entry point instead of internal renderer/parser classes, so they track real rebuild timing rather than component-only throughput.
Measured on PHP 8.5 with ext-md4c, ext-yaml, and ext-pcntl, xdebug off, OPCache disabled.
Benchmarks are run with xdebug disabled automatically (make bench sets XDEBUG_MODE=off).