Repository navigation
Run the benchmarks with Tally - #7059
Merged
Merged
Conversation
The benchmarks in tests/bench/data are now cases of AnalysisBench, run by phpstan/tally. The expected numbers moved from expected.neon into the comment at the top of each file, and the workflow runs tally run --shard and tally compare instead of the scripts in tests/bench. Amp-Thread-ID: https://ampcode.com/threads/T-01a1d525-9c4c-73cf-8edc-000aa8e78378
| run: | | ||
| mkdir -p tmp/bench-results | ||
| php tests/bench/shard.php "$SHARDS" "$SHARD" | xargs -P "$(nproc)" -I {} php tests/bench/run.php "tests/bench/data/{}" "tmp/bench-results/{}.neon" | ||
| run: "php vendor/bin/tally run --shard=${{ matrix.shard }}/${{ strategy.job-total }} --output=tmp/tally-results" |
| run: | | ||
| mkdir -p tmp/bench-results | ||
| php tests/bench/shard.php "$SHARDS" "$SHARD" | xargs -P "$(nproc)" -I {} php tests/bench/run.php "tests/bench/data/{}" "tmp/bench-results/{}.neon" | ||
| run: "php vendor/bin/tally run --shard=${{ matrix.shard }}/${{ strategy.job-total }} --output=tmp/tally-results" |
| run: | | ||
| mkdir -p tmp/bench-results | ||
| php tests/bench/shard.php "$SHARDS" "$SHARD" | xargs -P "$(nproc)" -I {} php tests/bench/run.php "tests/bench/data/{}" "tmp/bench-results/{}.neon" | ||
| run: "php vendor/bin/tally run --shard=${{ matrix.shard }}/${{ strategy.job-total }} --output=tmp/tally-results" |
PHP 7.4 reads #[ as a comment until the end of the line, so the attribute of AnalysisBench is on one line. Tally's sources use enums and readonly properties, which PHPStan does not parse for PHP < 8.1, so the benchmarks are not analysed there. Amp-Thread-ID: https://ampcode.com/threads/T-01a1d525-9c4c-73cf-8edc-000aa8e78378
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the scripts in
tests/benchwith phpstan/tally.tests/bench/AnalysisBench.phpanalyses each file intests/bench/data. PHPStan boots and analysesWarmup.phpin an uncounted#[Before]method, so only the analysis of the file is counted, same asmeasure.phpdid.expected.neoninto a comment at the top of each data file. They are the old CI numbers, so this run compares instructions and cycles with them.tally-resultsartifact withvendor/bin/tally accept.tally run --shard=N/4on four runners andtally compare --tableover all shards.phpstan/tallyis in the rootrequire-dev, the configuration istally.php.