Skip to content

Add manual bench workflow#7

Merged
coderdan merged 1 commit intomainfrom
bench-workflow
May 2, 2026
Merged

Add manual bench workflow#7
coderdan merged 1 commit intomainfrom
bench-workflow

Conversation

@coderdan
Copy link
Copy Markdown
Collaborator

@coderdan coderdan commented May 2, 2026

Summary

Adds `.github/workflows/bench.yml` for on-demand benchmark runs on the GitHub Actions Ubuntu x86_64 runner. Manual-only trigger (`workflow_dispatch`) so it doesn't run on every PR (~5–10 min).

Why

Until we have a dedicated x86 box, the GHA Ubuntu runner is the easiest way to validate that the x86 SSE work in #6 actually beats scalar on real silicon (Rosetta only confirms correctness, not perf). Numbers from a shared runner are noisy (~5–15% variance), but `base85` vs `base85-simd` are measured on the same hardware in the same run so the noise mostly cancels.

Usage

```sh

from CLI

gh workflow run bench --ref x86-simd

or from the Actions tab in the UI, choose a branch/sha

```

The job:

  1. Prints CPU model + available SIMD feature flags from `/proc/cpuinfo` (so we know what we measured).
  2. `cargo bench --bench encode --locked` with output captured.
  3. Prints a `time:` summary at the end of the log.
  4. Uploads the raw output and full criterion HTML report as a 30-day artifact.

Adds `.github/workflows/bench.yml` for on-demand benchmark runs on
the GitHub Actions Ubuntu x86_64 runner. Trigger via the Actions tab
or `gh workflow run bench --ref <branch-or-sha>`.

The shared runner produces noisy numbers (~5–15% variance) so this
isn't a regression gate, but it's useful for:
  - First-pass validation that the x86 SSE path actually beats
    scalar before we invest in dedicated benchmarking hardware.
  - Relative `base85` vs `base85-simd` comparison on the same
    silicon (noise mostly cancels).

Workflow steps:
  - Print CPU model + available SIMD feature flags from /proc/cpuinfo.
  - Install stable Rust + Swatinem/rust-cache@v2.
  - `cargo bench --bench encode --locked` with output captured.
  - Print a `time:` summary at the end of the log.
  - Upload `bench-output.txt` and the full criterion HTML report
    (`target/criterion/`) as a 30-day artifact.

Manual-only (`workflow_dispatch`) so it doesn't run on every PR
(the bench takes ~5–10 min and we don't gate on its numbers).
Copy link
Copy Markdown
Collaborator Author

@coderdan coderdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Human review

@coderdan coderdan merged commit bd299fc into main May 2, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant