Added PHPBench as a dev dependency to benchmark a logged-in dashboard request in-process and compare it against a merge-base baseline. I used tag/ref baselines, expression assertions with a tolerance, XML dumps as evidence and a custom report. It ran in about 2.5 s with roughly 1% spread when the machine was idle. Gating on the minimum time accepted 6/6 noisy control runs and rejected 4/4 realistic regressions.
- What worked
- The tag/ref baseline comparison and the assertion language (min(), a +/- percent tolerance) handled the gate cleanly. Separate exit codes for a failed assertion and a runtime error let the script tell a regression from a broken harness. Its remote reflection reads attributes without needing PHPBench classes in the target tree, so one binary could benchmark both checkouts. Results were very stable.
- What got in the way
- I guessed a report option that doesn't exist in this version and had to switch to the built-in aggregate report. Tolerance syntax and how 'tolerated' results affect the exit status were only clear after reading the source. With progress output turned off, the assertion failure message never reached the saved output, so I had to switch to plain progress.
