Skip to content

Commit a1cab7c

Browse files
committed
fix: correct PHPBench 1.6 configuration (runner.* options)
ERROR WAS: phpbench.json had top-level options that don't exist in 1.6 - 'bootstrap', 'env', 'extensions', 'output', 'paths' are not valid FIXED: Use correct PHPBench 1.6 options structure - runner.bootstrap, runner.path, runner.iterations, runner.revs, runner.warmup - report.generators for output type WORKFLOW: Use CLI flags instead of env var names - --iterations=20 (not --env=ci) - --revs=10 - --warmup=2 - Multiple --output flags for both json and console This should now actually run the benchmarks. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 43e4564 commit a1cab7c

3 files changed

Lines changed: 12 additions & 41 deletions

File tree

.github/copilot-instructions.md

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,18 @@ Benchmarks use **PHPBench** for rigorous performance testing with statistical an
1717
# Run all benchmarks with aggregate statistics
1818
composer benchmark:run
1919

20-
# Compare against main branch (requires git history)
21-
composer benchmark:compare
20+
# Run with stricter settings (multiple revisions)
21+
vendor-bin/phpbench/vendor/phpbench/phpbench/bin/phpbench run --revs=10 --iterations=20 --warmup=2
2222

23-
# Direct PHPBench invocation
23+
# Direct PHPBench invocation with custom options
2424
vendor-bin/phpbench/vendor/phpbench/phpbench/bin/phpbench run --report=aggregate
2525
```
2626

2727
PHPBench automatically:
2828
- Runs warmup iterations (eliminates JIT/opcache startup noise)
2929
- Executes multiple revisions for statistical confidence
30-
- Detects performance regressions
3130
- Reports mean, min, max, stdev, variance per benchmark
3231

33-
### Updating performance baseline
34-
35-
After merge to `main`, baseline must be updated manually (branch protection prevents auto-commit):
36-
37-
1. Checkout `main`: `git checkout main && git pull`
38-
2. Run latest benchmarks: `composer benchmark:run --env=ci --output=json:build/benchmark-results.json`
39-
3. Update baseline: `cp build/benchmark-results.json .github/.performance/baseline.json`
40-
4. Commit: `git add .github/.performance/baseline.json && git commit -s -m "chore: update performance baseline"`
41-
5. Push: `git push origin main`
42-
43-
Alternatively, download benchmark artifact from GitHub Actions > main branch run.
44-
4532
## Compliance and contribution
4633

4734
- DCO sign-off is mandatory for every commit.

.github/workflows/performance.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ on:
1212
jobs:
1313
performance:
1414
runs-on: ubuntu-latest
15-
env:
16-
# Conservative thresholds based on typical xobject-template compilation times
17-
# Keep benchmarks tight to catch regressions early
18-
BENCH_REVS: "10"
19-
BENCH_ITERATIONS: "20"
20-
BENCH_WARMUP: "2"
2115
steps:
2216
- uses: actions/checkout@v6
2317
with:
@@ -37,7 +31,9 @@ jobs:
3731
- name: Run benchmarks (strict CI mode with verbose output)
3832
run: |
3933
vendor-bin/phpbench/vendor/phpbench/phpbench/bin/phpbench run \
40-
--env=ci \
34+
--iterations=20 \
35+
--revs=10 \
36+
--warmup=2 \
4137
--report=aggregate \
4238
--output=json:build/benchmark-results.json \
4339
--output=console

phpbench.json

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
11
{
2-
"bootstrap": "vendor/autoload.php",
3-
"extensions": ["PhpBench\\Extensions\\CoreExtension"],
4-
"paths": ["benchmarks"],
5-
"output": "console",
6-
"env": {
7-
"default": {
8-
"title": "default",
9-
"iterations": 10,
10-
"revs": 5,
11-
"warmup": 1
12-
},
13-
"ci": {
14-
"title": "CI (strict)",
15-
"iterations": 20,
16-
"revs": 10,
17-
"warmup": 2
18-
}
19-
}
2+
"runner.bootstrap": "vendor/autoload.php",
3+
"runner.path": "benchmarks",
4+
"runner.iterations": 10,
5+
"runner.revs": 5,
6+
"runner.warmup": 1,
7+
"report.generators": ["aggregate"]
208
}

0 commit comments

Comments
 (0)