name: Benchmarks
on:
push:
pull_request:
workflow_dispatch:
jobs:
bench:
name: cargo bench
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libssl-dev pkg-config
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run protocol benchmarks
run: |
cargo bench --bench protocol --features default -- --sample-size 20 --noplot 2>&1 | tee bench-protocol.txt
- name: Run relay benchmarks
run: |
cargo bench --bench relay --features default -- --sample-size 10 --test-threads 1 --noplot 2>&1 | tee bench-relay.txt
- name: Upload benchmark output
uses: actions/upload-artifact@v7
with:
name: librtmp2-benchmarks
path: bench-*.txt