Skip to content

Commit

Permalink
Merge pull request #98 from alankritdabral/revert-96-bencher
Browse files Browse the repository at this point in the history
Revert "chore: update benchmarks"
  • Loading branch information
alankritdabral authored Apr 8, 2024
2 parents 2a45801 + bfb8304 commit 427fb18
Showing 1 changed file with 21 additions and 42 deletions.
63 changes: 21 additions & 42 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,44 +69,37 @@ jobs:
name: body
path: ci-benchmark/body.md

Track_and_Cache_Benchmarks:
name: Track and Cache Micro Benchmarks
Cache_Benchmarks:
name: Cache Micro Benchmarks result
if: (github.event_name == 'push' && github.ref == 'refs/heads/main')
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-latest
runs-on: benchmarking-runner
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Install Bencher CLI
uses: bencherdev/bencher@main

- name: Run and track Benchmarks
- name: Run Benchmarks
run: |
cargo bench > benches/base.txt
bencher run \
--project tailcall-2192953494 \
--branch main \
--testbed benchmarking-runner \
--token "${{ secrets.BENCHER_API_TOKEN }}" \
--adapter rust_criterion \
--file benches/base.txt
cargo install cargo-criterion rust-script
cargo criterion --message-format=json > benches/main_benchmarks.json
./scripts/json_to_md.rs benches/main_benchmarks.json > benches/main_benchmarks.md
cat benches/main_benchmarks.md
- name: Cache Criterion Benchmarks Json
uses: actions/cache@v4
with:
path: benches/base.txt
path: benches/main_benchmarks.json
key: criterion_benchmarks_${{ github.sha }}

Criterion_Compare:
name: Comparing Micro Benchmarks
if: "contains(github.event.pull_request.labels.*.name, 'ci: benchmark')"
runs-on: ubuntu-latest
runs-on: benchmarking-runner
permissions:
pull-requests: write
contents: write
Expand All @@ -121,36 +114,22 @@ jobs:

- name: Run Criterion Benchmarks
run: |
cargo bench > benches/change.txt
cargo install cargo-criterion rust-script
cargo criterion --message-format=json > benches/benchmarks.json
./scripts/json_to_md.rs benches/benchmarks.json > benches/change_benchmarks.md
- name: Print Criterion Benchmarks
run: cat benches/change_benchmarks.md

- name: Restore file
uses: actions/cache@v4
with:
path: benches/base.txt
path: benches/main_benchmarks.json
key: criterion_benchmarks_${{ github.event.pull_request.base.sha }}
fail-on-cache-miss: true

- name: Install Bencher CLI
uses: bencherdev/bencher@main
- name: Print Benchmark Comparision
run: ./scripts/criterion_compare.rs benches/main_benchmarks.json benches/benchmarks.json table

- name: Create PR threshold
run: |
bencher threshold create \
--project tailcall-2192953494 \
--branch '${{ github.head_ref }}' \
--testbed benchmarking-runner \
--adapter rust_criterion \
--measure latency \
--test t \
--upper-boundary 0.90 \
--token "${{ secrets.BENCHER_API_TOKEN }}"
- name: Track PR Benchmarks
run: |
bencher run \
--branch '${{ github.head_ref }}' \
--token "${{ secrets.BENCHER_API_TOKEN }}" \
--ci-number '${{ github.event.pull_request.number }}' \
--github-actions "${{ secrets.GITHUB_TOKEN }}" \
--err \
--file benches/change.txt
- name: Check Degradation
run: ./scripts/criterion_compare.rs benches/main_benchmarks.json benches/benchmarks.json check

0 comments on commit 427fb18

Please sign in to comment.