-
Notifications
You must be signed in to change notification settings - Fork 8
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
Seeking feedback: improved PR benchmark workflow #121
Comments
Maybe let's give it a try in one of the repos! |
👍 I'll keep pushing forward with a goal of getting a PR up in The only remaining annoyance is that the "run workflow when tag is added" trigger within GitHub actions only fires once the workflow has been committed to the default branch, so I'll have to continue testing in and referring to my personal fork. |
Just because we are not giving feedback, doesnt mean that we are uninterested. Its actually more an issue of reproducability. When you think your workflow is perfect give us feedback. We can then check how your code is and that you are not doing malicious stuff 👿 and if it makes sense we will merge it. |
Thanks for the encouragement! I am still working at various sampling strategies and to try to minimize the run-to-run variance. |
How'd you get on with this @mweberxyz? |
After having spent time looking at the implementation of the PR benchmark workflow and in-tree benchmarks in fastify/point-of-view, fastify/fastify, and fastify/workflows, I've managed to pull it all together. Hopefully the result is more usable with less code duplication, and provides better actionable information to PR reviewers.
I feel like things are in a stable place now, so I'm seeking feedback on if this is going to be valuable to reviewers, my approach, and the changes to each of the three repos needed. Open to any and all feedback before I spent any more time on it.
Demo
fastify
point-of-view
Required changes
fastify/workflows
: mweberxyz@9cee011fastify/fastify
: mweberxyz/fastify@053330efastify/point-of-view
: mweberxyz/point-of-view@07b17c8Sample PRs
fastify/fastify: PR from fork
mweberxyz/fastify#3
Merges code from a fork into my fork, to demonstrate that the "base" benchmark are run against the target of the PR. Additionally, it shows warnings in the comment because the "head" aka PR branch does not run the
parser.js
correctly and all requests return 404s.fastify/point-of-view: PR from same repo with performance degredation
mweberxyz/point-of-view#5
Merges code from a branch into the default branch of the same fork. It reverts a performance improvement, to demonstrate what it looks like when a PR really tanks performance.
Approach
benchmarks-dir
directory is executed (except any file specified in the inputfiles-to-ignore
), then autocannon is run 3 times* for 5 seconds* each against each file, taking the maximum result of mean req/s of the three runsnpx
autocannon
is a listed dep, or installedautocannon
writes it's table output to stderr, so the raw results can be seen if needed in the action logs--on-port
is used to spawn benchmark scriptsfastify/point-of-view/benchmark.js
node-versions
inputfastify/workflows
workflow uses different versions of Node for benchmarks than is currently implemented infastify/fastify
examples/benchmark/parser.js
infastify/fastify
Lessons
main
after the PR is created, thegithub.event.pull_request.base.sha
is not updated. That is to say, when running thebase
benchmarks, they always run against themain
commit as-of-the-time the PR was created.github.event.pull_request.base.ref
insteadFuture work
timeout-minutes
to the benchmark stepsnpm run benchmark
and see the same type of outputThe text was updated successfully, but these errors were encountered: