Skip to content

Commit

Permalink
perf: cibench workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronO committed Sep 1, 2024
1 parent ab76284 commit 7ad6294
Showing 1 changed file with 108 additions and 0 deletions.
108 changes: 108 additions & 0 deletions .github/workflows/cibench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: CI Benchmarks
on:
pull_request:
branches: [master]

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-C target-cpu=native"

jobs:
benchmark:
name: Run benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Install critcmp
run: cargo install critcmp

- name: Run benchmarks (master)
run: |
git checkout master
cargo bench --bench parse -- --save-baseline master
- name: Run benchmarks (PR)
run: |
git checkout ${{ github.event.pull_request.head.sha }}
cargo bench --bench parse -- --save-baseline pr
- name: Compare benchmarks
run: |
critcmp master pr-${{ github.event.pull_request.number }}
benchmark-simd:
name: Run SIMD benchmarks
runs-on: ubuntu-latest
strategy:
matrix:
feature: [swar, sse42, avx2]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Install critcmp
run: cargo install critcmp

- name: Run benchmarks (master)
run: |
git checkout master
cargo bench --bench parse --features ${{ matrix.feature }} -- --save-baseline master-${{ matrix.feature }}
- name: Run benchmarks (PR)
run: |
git checkout ${{ github.event.pull_request.head.sha }}
cargo bench --bench parse --features ${{ matrix.feature }} -- --save-baseline pr-${{ matrix.feature }}
- name: Compare benchmarks
run: |
critcmp master-${{ matrix.feature }} pr-${{ matrix.feature }}-${{ github.event.pull_request.number }}
benchmark-aarch64:
name: Run aarch64/neon benchmarks
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Install critcmp
run: cargo install critcmp

- name: Run benchmarks (master)
run: |
git checkout master
cargo bench --bench parse --features neon -- --save-baseline master-aarch64
- name: Run benchmarks (PR)
run: |
git checkout ${{ github.event.pull_request.head.sha }}
cargo bench --bench parse --features neon -- --save-baseline pr-aarch64
- name: Compare benchmarks
run: |
critcmp master-aarch64 pr-aarch64-${{ github.event.pull_request.number }}

0 comments on commit 7ad6294

Please sign in to comment.