Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions .github/workflows/bench.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Benchmark Comparison

on:
pull_request:
types: [opened, reopened, synchronize]

concurrency:
group: bench-${{ github.head_ref }}
cancel-in-progress: true

jobs:
bench-base:
name: Benchmark main
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main

- name: Install stable Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo artifacts
uses: Swatinem/rust-cache@v2

- name: Run benchmarks on main
run: CI=1 cargo bench -p ractor
env:
CI: 1

- name: Install critcmp
run: cargo install critcmp --locked

- name: Export main baseline
run: critcmp --export new > main.json

- name: Upload main baseline
uses: actions/upload-artifact@v4
with:
name: bench-baseline-main
path: main.json
retention-days: 1

bench-pr:
name: Benchmark PR and compare
runs-on: ubuntu-latest
needs: bench-base
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4

- name: Install stable Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo artifacts
uses: Swatinem/rust-cache@v2

- name: Download main baseline
uses: actions/download-artifact@v4
with:
name: bench-baseline-main

- name: Run benchmarks on PR branch
run: CI=1 cargo bench -p ractor
env:
CI: 1

- name: Install critcmp
run: cargo install critcmp --locked

- name: Compare benchmarks
id: compare
run: |
RESULT=$(critcmp main.json new)
echo "$RESULT"
{
echo "result<<EOF"
echo "$RESULT"
echo "EOF"
} >> "$GITHUB_OUTPUT"

- name: Find existing benchmark comment
uses: peter-evans/find-comment@v3
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: github-actions[bot]
body-includes: Benchmark Comparison

- name: Post or update benchmark comment
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.find-comment.outputs.comment-id }}
edit-mode: replace
body: |
## Benchmark Comparison (PR vs `main`)

<details>
<summary>Results</summary>

```
${{ steps.compare.outputs.result }}
```

</details>

_Benchmarks run on shared CI hardware (`ubuntu-latest`). Differences under ~5% may be noise._
7 changes: 6 additions & 1 deletion ractor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ractor"
version = "0.15.10"
version = "0.15.11"
authors = ["Sean Lawlor", "Evan Au", "Dillon George"]
description = "A actor framework for Rust"
documentation = "https://docs.rs/ractor"
Expand Down Expand Up @@ -111,3 +111,8 @@ required-features = []
name = "simple_advanced_benchmarks"
harness = false
required-features = []

[[bench]]
name = "factory"
harness = false
required-features = []
Loading
Loading