-
Notifications
You must be signed in to change notification settings - Fork 341
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
feat: add benchmarks and performance checks on PRs #881
Conversation
6348a05
to
97e4e45
Compare
.benchmarks/gobenchdata-checks.yml
Outdated
benchmarks: [] | ||
diff: (current.NsPerOp - base.NsPerOp) / base.NsPerOp * 100 | ||
thresholds: | ||
max: 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what it means, and what happens if we hit this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are rules that will be executed when the benchmark-check.yml action is triggered on every pr. It will compare the diff between the operations with the previous execution, and if the diff is bigger than 10%, it will fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example check output report: https://github.com/ajnavarro/gno/actions/runs/5280312972/jobs/9553479785#step:4:63
.benchmarks/gobenchdata-web.yml
Outdated
charts: | ||
- name: Type assertion benchmarks (gnovm) | ||
benchmarks: [ 'TypeAssertion.' ] | ||
package: github.com\/gnolang\/gno\/gnovm\/pkg\/gnolang | ||
- name: Reflect benchmarks (gnovm) | ||
benchmarks: [ 'Reflect.' ] | ||
package: github.com\/gnolang\/gno\/gnovm\/pkg\/gnolang | ||
- name: Equality benchmarks (gnovm) | ||
benchmarks: [ '.Equality' ] | ||
package: github.com\/gnolang\/gno\/gnovm\/pkg\/gnolang | ||
- name: LoopyMain benchmarks (gnovm) | ||
benchmarks: [ '.LoopyMain' ] | ||
package: github.com\/gnolang\/gno\/gnovm\/pkg\/gnolang | ||
- name: Mempool (tm2) | ||
package: ^github.com/gnolang/gno/tm2/pkg/bft/mempool$ | ||
- name: State (tm2) | ||
package: ^github.com/gnolang/gno/tm2/pkg/bft/state$ | ||
- name: Types (tm2) | ||
package: ^github.com/gnolang/gno/tm2/pkg/bft/types$ | ||
- name: WAL (tm2) | ||
package: ^github.com/gnolang/gno/tm2/pkg/bft/wal$ | ||
- name: Bcrypt (tm2) | ||
package: ^github.com/gnolang/gno/tm2/pkg/crypto/bcrypt$ | ||
- name: ed25519 (tm2) | ||
package: ^github.com/gnolang/gno/tm2/pkg/crypto/ed25519$ | ||
- name: Merkle (tm2) | ||
package: ^github.com/gnolang/gno/tm2/pkg/crypto/merkle$ | ||
- name: secp256k1 (tm2) | ||
package: ^github.com/gnolang/gno/tm2/pkg/crypto/secp256k1$ | ||
- name: iavl (tm2) | ||
package: ^github.com/gnolang/gno/tm2/pkg/iavl. | ||
- name: random (tm2) | ||
package: ^github.com/gnolang/gno/tm2/pkg/random$ | ||
- name: auth (tm2) | ||
package: ^github.com/gnolang/gno/tm2/pkg/sdk/auth$ | ||
- name: cache (tm2) | ||
package: ^github.com/gnolang/gno/tm2/pkg/store/cache$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can probably generate this dynamically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if they seem to be the same, I had to tweak every package to have good graphs on the generated dashboard. As an example, LoopyMain benchmark takes a lot more time compared with other benchmarks on the same package, making the output graph unreadable, so I split them into two sections, one with the LoopyMain benchmark alone, and the other with all the other benchmarks.
- uses: actions/setup-go@v2 | ||
with: { go-version: "1.20" } | ||
- name: gobenchdata publish | ||
run: go run go.bobheadxi.dev/gobenchdata@v1 action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a go install step before; just to make sure that we've more comprehensible error handling and sense of speed for install and run.
wow, that looks powerful, and I like how it replaces an infra with git 👍 |
@@ -0,0 +1,23 @@ | |||
name: benchmarks publish |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be merged to have a single github action; maybe by merging the on:
triggers and adding a if push + branch=master
condition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, they are two different things, one is adding information about performance deltas on the PR, and the other is generating the dashboard with all the benchmark results. I can merge them if it clarifies what benchmark action does.
0eacec2
to
3df7b56
Compare
Until I have a self-hosted runner managed by the company and a token with write permissions, I managed to do it on my own on a fork and using my home server to run the benchmarks: https://ajnavarro.com/gno-benchmarks/
|
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
demand too Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
fc10691
to
ef36bbd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this effort very much - it's a start in the right direction for performance tracking
I've left minor comments, otherwise looks great 💯
@@ -0,0 +1,32 @@ | |||
# Benchmarks | |||
|
|||
This folder is where benchmarks are configured to be added on the dashboard generated in [benchmarks](https://gnoland.github.io/benchmarks). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea, let's do it
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
As suggested by @moul , I changed to publish all benchmark results into a local branch, |
Description
Add benchmark monitoring to keep track of improved/decreased performance. We also added checks to run fast benchmarks on every PR.
it closes #689
Still a WIP:
.benchmarks
folder to help people add new benchmarks to graphs and PR checks.Contributors Checklist
BREAKING CHANGE: xxx
message was included in the description