Skip to content

Commit ee6f9e2

Browse files
committed
Include branch in benchmarking information
This allows https://nielsdos.github.io/php-benchmark-visualisation/ to only show commits from master (or a specific branch). Otherwise we get confusing, undulating commits from different branches, with potentially wildly different performance. Closes GH-12101
1 parent b17958e commit ee6f9e2

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.github/workflows/push.yml

+1
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ jobs:
277277
- name: Show diff
278278
if: github.event_name == 'pull_request'
279279
run: |-
280+
set -x
280281
php benchmark/generate_diff.php \
281282
${{ github.sha }} \
282283
$(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.sha }}) \

benchmark/benchmark.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ function main() {
1313
global $storeResult;
1414

1515
$data = [];
16+
if (false !== $branch = getenv('GITHUB_REF_NAME')) {
17+
$data['branch'] = $branch;
18+
}
1619
$data['Zend/bench.php'] = runBench(false);
1720
$data['Zend/bench.php JIT'] = runBench(true);
1821
$data['Symfony Demo 2.2.3'] = runSymfonyDemo(false);
@@ -66,7 +69,7 @@ function runWordpress(bool $jit): array {
6669
* easily alter the phar file */
6770
runPhpCommand([
6871
'-d error_reporting=0',
69-
'wp-cli.phar',
72+
'wp-cli.phar',
7073
'core',
7174
'install',
7275
'--url=wordpress.local',

benchmark/generate_diff.php

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ function main(?string $headCommitHash, ?string $baseCommitHash) {
2626
$output = "| Benchmark | Base ($baseCommitHashShort) | Head ($headCommitHashShort) | Diff |\n";
2727
$output .= "|---|---|---|---|\n";
2828
foreach ($headSummary as $name => $headBenchmark) {
29+
if ($name === 'branch') {
30+
continue;
31+
}
2932
$baseInstructions = $baseSummary[$name]['instructions'] ?? null;
3033
$headInstructions = $headSummary[$name]['instructions'];
3134
$output .= "| $name | "

0 commit comments

Comments
 (0)