Skip to content

Commit

Permalink
Merge pull request #9 from Miaxos/feat-add-bencher
Browse files Browse the repository at this point in the history
feat: add bencher
  • Loading branch information
Miaxos committed Jan 11, 2024
2 parents 84317ed + 024645f commit 111b7cc
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/bencher.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
schedule:
- cron: '18 * * * *'
push:
branches:
- main

jobs:
benchmark_with_bencher:
name: Continuous Benchmarking with Bencher
runs-on: ubuntu-latest
env:
BENCHER_PROJECT: sharded-thread
BENCHER_TESTBED: github-actions
BENCHER_ADAPTER: rust_criterion
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
- uses: bencherdev/bencher@main
- name: Track Benchmarks with Bencher
run: |
bencher run \
--iter 16 \
--branch "$GITHUB_REF_NAME" \
--token "${{ secrets.BENCHER_API_TOKEN }}" \
--err \
"cargo bench"
30 changes: 30 additions & 0 deletions .github/workflows/bencher_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on: pull_request

permissions:
issues: write

jobs:
benchmark_pr_with_bencher:
permissions: write-all
name: Continuous Benchmarking with Bencher
runs-on: ubuntu-latest
env:
BENCHER_PROJECT: sharded-thread
BENCHER_TESTBED: github-actions
BENCHER_ADAPTER: rust_criterion
steps:
- uses: actions/checkout@v4
- uses: bencherdev/bencher@main
- name: Track Benchmarks with Bencher
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
bencher run \
--iter 1 \
--if-branch "$GITHUB_REF_NAME" \
--else-if-branch "$GITHUB_BASE_REF" \
--else-if-branch main \
--github-actions "$GITHUB_TOKEN" \
--token "${{ secrets.BENCHER_API_TOKEN }}" \
--err \
"cargo bench"
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ want to change the thread handling the stream.

You can check some examples in the tests.

## Benchmarks

Those benchmarks are only indicative, they are running in GA. You should run
your own on the targeted hardware.

<p align="center">
<a href="https://bencher.dev/perf/sharded-thread?key=true&reports_per_page=4&branches_per_page=8&testbeds_per_page=8&benchmarks_per_page=8&reports_page=1&branches_page=1&testbeds_page=1&benchmarks_page=1"><img src="https://api.bencher.dev/v0/projects/sharded-thread/perf/img?branches=abb3e39f-486d-45af-924f-3614316b6781&testbeds=63179e4d-88f0-4247-85f4-ad6952282d58&benchmarks=2b3141e3-f3f6-42b7-8209-43381c453c67&measures=0e7c206f-e0e3-4672-be1a-b3820dc2789a&start_time=1702401209000&end_time=1704993221000&title=Benches" title="Benches" alt="Benches for sharded-thread - Bencher" width="60%" /></a>
</p>

## References

- [Glommio example on their sharding](https://github.com/DataDog/glommio/blob/master/examples/sharding.rs)
Expand Down

0 comments on commit 111b7cc

Please sign in to comment.