Commit 8447820
committed
chore: add performance regression guards with PHPBench assertions
PHPBench aggregates meaningful performance validation:
WHAT IT DOES:
- Warmup iterations: eliminates JIT/opcache startup cost
- Multiple revisions (5-10): catches outliers and variance
- Statistical output: mean, stdev, min, max per benchmark
- Baseline comparison: PR results vs main branch benchmark
- Assertions: automatic failure if mean >baseline+5% or memory >baseline+10%
CI INTEGRATION:
- Strict mode (--env=ci): 10 revisions × 20 iterations = 200 runs per benchmark
- JSON output: results saved as artifact
- Baseline tracking: .github/.performance/baseline.json
- Main branch: auto-updates baseline after merge
QUALITY GUARANTEE:
- False positives eliminated: warmup + statistical confidence
- Regression detection: assertions fail PRs with degradation
- Maintainer visibility: artifact and CI logs show comparison
UPDATED:
- phpbench.json: Added strict CI environment and assertions
- .github/workflows/performance.yml: Baseline comparison and artifact upload
- .github/.performance/baseline.json: Initial baseline reference
Before: ad-hoc scripts without warmup, no assertions, unreliable averages
After: rigorous statistical validation with automatic regression detection
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>1 parent 83f74e9 commit 8447820
3 files changed
Lines changed: 67 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
27 | | - | |
28 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
6 | 30 | | |
0 commit comments