Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move benchmarks to a new ring-bench crate. #1710

Merged
merged 1 commit into from
Oct 7, 2023
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
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ jobs:
- run: sh mk/package.sh
shell: bash

# Intentionally excludes benchmarks for build performance reasons.
test:
# Don't run duplicate `push` jobs for the repo owner's PRs.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
Expand Down Expand Up @@ -322,6 +323,28 @@ jobs:
(!contains(matrix.host_os, 'macos') || matrix.mode != '--release') }}
run: mk/check-symbol-prefixes.sh --target=${{ matrix.target }}

test-bench:
# Don't run duplicate `push` jobs for the repo owner's PRs.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

runs-on: ubuntu-22.04

steps:
- run: sudo apt-get update -y

- uses: briansmith/actions-checkout@v2
with:
persist-credentials: false

- run: mk/install-build-tools.sh --target=x86_64-unknown-linux-gnu

- uses: briansmith/actions-rs-toolchain@v1
with:
override: true
toolchain: stable

- run: cargo test -p ring-bench --all-features --all-targets

# XXX: GitHub Actions won't let us test all the combinations of features in
# the "test" matrix because the resultant matrix would be larger than the
# maximum they allow.
Expand Down
16 changes: 6 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,6 @@ libc = { version = "0.2.100", default-features = false }
[build-dependencies]
cc = { version = "1.0.69", default-features = false }

[dev-dependencies]
criterion = { version = "0.4", default-features = false }

[features]
# These features are documented in the top-level module's documentation.
default = ["alloc", "dev_urandom_fallback"]
Expand Down Expand Up @@ -225,10 +222,9 @@ lto = true
debug-assertions = false
codegen-units = 1

[[bench]]
name = "aead"
harness = false

[[bench]]
name = "x25519"
harness = false
[workspace]
members = [
# intentionally not a default member so that `cargo test` doesn't cause criterion.rs and all its
# dependencies to get built.
"bench",
]
21 changes: 21 additions & 0 deletions bench/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
edition = "2021"
name = "ring-bench"
publish = false
version = "0.1.0"

[dependencies]
ring = { path = "../" }

[dev-dependencies]
criterion = { version = "0.4", default-features = false }

[[bench]]
name = "aead"
harness = false
path = "aead.rs"

[[bench]]
name = "x25519"
harness = false
path = "x25519.rs"
File renamed without changes.
File renamed without changes.