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

CI: add benchmark workflow #91

Merged
merged 2 commits into from
Mar 12, 2024
Merged

CI: add benchmark workflow #91

merged 2 commits into from
Mar 12, 2024

Conversation

trym-b
Copy link
Contributor

@trym-b trym-b commented Mar 12, 2024

Best reviewed commit by commit

@trym-b
Copy link
Contributor Author

trym-b commented Mar 12, 2024

This is how the benchmark will look like: https://trym-b.github.io/warchaeology/benchmarks/ubuntu-22.04/

@trym-b
Copy link
Contributor Author

trym-b commented Mar 12, 2024

This is how a benchmark failure will look like: https://github.com/trym-b/warchaeology/actions/runs/8201485917

cmd/cat/cat_test.go Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
@trym-b
Copy link
Contributor Author

trym-b commented Mar 12, 2024

Ready for next round @maeb

This commit adds a dummy benchmark to the cat
command. Its only purpose is to enable the project
to run any benchmarks at all, which is needed by
the next commit.
# Motivation

To avoid performance regressions, this commit adds
a benchmark job to the CI workflow.

The idea is that if a given PR decreases the
performance sufficiently, (e.g. 150% or more), the
CI will fail and the PR cannot be merged.

The benchmark results should be visible at
https://nlnwa.github.io/warchaeology/benchmarks/ubuntu-22.04
after this commit has been merged.

# Changes

Added a publish benchmark job in the
`publish_benchmarks.yml` that also runs the
benchmarks and publishes them to the github pages
branch (currently `gh-pages`).

# Quirks

We need to re-run the benchmark results since
getting artifacts from a separate workflow is not
trivial. Ideally we should just run the benchmarks
once.

Publishing benchmarks must live in a separate
workflow, since the permissions it needs to write
to `gh-pages` should not be exposed to external
users creating PRs targeting this repository.

An alternative would be to not run workflows when
receiving external PRs, but that would make the
developer experience for contributors worse.

# Future work

After this PR has been merged, doing the actual
comparison should be a priority. Currently the
benchmarks are only published to the `gh-pages`
branch, and not actually compared to anything.

Add `Windows` to the benchmark matrix.
@trym-b trym-b merged commit 5f11080 into main Mar 12, 2024
5 checks passed
@trym-b trym-b deleted the ci/add-benchmark-workflow branch March 12, 2024 10:11
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.

2 participants