Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phpbench: added composer scripts for recording/comparing a baseline #38

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Mar 14, 2021

I am in the process of building a phpbench baseline compare feature as a github action workflow.

to get it running, we need this composer scripts merged into the main branch firsts.

could you please squash and merge this commits.

in the end the goal is to have a github annotation at pull request level which indicates the perf impact of a given PR like

grafik

phpbench.json Outdated
@@ -1,3 +1,4 @@
{
"bootstrap": "vendor/autoload.php"
"bootstrap": "vendor/autoload.php",
"xml_storage_path": "/tmp/.phpbench/storage"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with this line the baseline generated data is stored within the system temp dir.

that way we can easily checkout a different git branch without loosing data, which would otherwise be stored within the current repo folder

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep this in <project root>.phpbench and add it to .gitignore if it's not already -- it's useful for various PHPBench artifacts.

Copy link
Contributor Author

@staabm staabm Mar 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx for your input! adjusted per feedback

@@ -63,6 +63,8 @@
"phpunit": "vendor/bin/phpunit",
"psalm": "vendor/bin/psalm",
"uptodocs": "docs/testdocs",
"benchmark-baseline": "phpbench run benchmarks --report=aggregate --tag=original --retry-threshold=5",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this script would generate a baseline and store its runtimes

@@ -63,6 +63,8 @@
"phpunit": "vendor/bin/phpunit",
"psalm": "vendor/bin/psalm",
"uptodocs": "docs/testdocs",
"benchmark-baseline": "phpbench run benchmarks --report=aggregate --tag=original --retry-threshold=5",
"benchmark-compare-baseline": "phpbench run benchmarks --report=aggregate --ref=original --retry-threshold=5",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after a baseline has been saved using composer benchmark-baseline one can then invoke composer benchmark-compare-baseline which then indicates relativ differences compared to the baselined performance scores

@staabm staabm marked this pull request as ready for review March 14, 2021 19:12
@staabm
Copy link
Contributor Author

staabm commented Mar 14, 2021

@turanct could you squash and merge this PR. after this PR have been merged, I could built the corresponding github action in #37 on top of it.

the composer scripts as defined here are even usefull without the github action style changes, to ease perf compare new changes as they come in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants