mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
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
This commit is contained in:
parent
b17958e7be
commit
ee6f9e294c
3 changed files with 8 additions and 1 deletions
1
.github/workflows/push.yml
vendored
1
.github/workflows/push.yml
vendored
|
@ -277,6 +277,7 @@ jobs:
|
||||||
- name: Show diff
|
- name: Show diff
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
run: |-
|
run: |-
|
||||||
|
set -x
|
||||||
php benchmark/generate_diff.php \
|
php benchmark/generate_diff.php \
|
||||||
${{ github.sha }} \
|
${{ github.sha }} \
|
||||||
$(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.sha }}) \
|
$(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.sha }}) \
|
||||||
|
|
|
@ -13,6 +13,9 @@ function main() {
|
||||||
global $storeResult;
|
global $storeResult;
|
||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
|
if (false !== $branch = getenv('GITHUB_REF_NAME')) {
|
||||||
|
$data['branch'] = $branch;
|
||||||
|
}
|
||||||
$data['Zend/bench.php'] = runBench(false);
|
$data['Zend/bench.php'] = runBench(false);
|
||||||
$data['Zend/bench.php JIT'] = runBench(true);
|
$data['Zend/bench.php JIT'] = runBench(true);
|
||||||
$data['Symfony Demo 2.2.3'] = runSymfonyDemo(false);
|
$data['Symfony Demo 2.2.3'] = runSymfonyDemo(false);
|
||||||
|
@ -66,7 +69,7 @@ function runWordpress(bool $jit): array {
|
||||||
* easily alter the phar file */
|
* easily alter the phar file */
|
||||||
runPhpCommand([
|
runPhpCommand([
|
||||||
'-d error_reporting=0',
|
'-d error_reporting=0',
|
||||||
'wp-cli.phar',
|
'wp-cli.phar',
|
||||||
'core',
|
'core',
|
||||||
'install',
|
'install',
|
||||||
'--url=wordpress.local',
|
'--url=wordpress.local',
|
||||||
|
|
|
@ -26,6 +26,9 @@ function main(?string $headCommitHash, ?string $baseCommitHash) {
|
||||||
$output = "| Benchmark | Base ($baseCommitHashShort) | Head ($headCommitHashShort) | Diff |\n";
|
$output = "| Benchmark | Base ($baseCommitHashShort) | Head ($headCommitHashShort) | Diff |\n";
|
||||||
$output .= "|---|---|---|---|\n";
|
$output .= "|---|---|---|---|\n";
|
||||||
foreach ($headSummary as $name => $headBenchmark) {
|
foreach ($headSummary as $name => $headBenchmark) {
|
||||||
|
if ($name === 'branch') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$baseInstructions = $baseSummary[$name]['instructions'] ?? null;
|
$baseInstructions = $baseSummary[$name]['instructions'] ?? null;
|
||||||
$headInstructions = $headSummary[$name]['instructions'];
|
$headInstructions = $headSummary[$name]['instructions'];
|
||||||
$output .= "| $name | "
|
$output .= "| $name | "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue