Skip to content

Commit

Permalink
perf(benchmarks): move benchmarks to a crate
Browse files Browse the repository at this point in the history
  • Loading branch information
codahale committed Oct 28, 2023
1 parent b3801f7 commit 517d6e8
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 11 deletions.
11 changes: 9 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ documentation = "https://docs.rs/lockstitch/"
keywords = ["crypto", "aegis-128l", "sha-256", "hazmat"]
categories = ["cryptography", "no-std"]
readme = "README.md"
include = ["src/**/*", "benches/**/*", "tests/**/*", "LICENSE", "README.md", "design.md", "perf.md"]
include = ["src/**/*", "tests/**/*", "LICENSE", "README.md", "design.md", "perf.md"]

[dependencies]
aes = { version = "0.8.3", features = ["hazmat"], optional = true }
Expand All @@ -27,20 +27,15 @@ portable = ["aes"]
std = []

[workspace]
members = ["xtask"]
members = ["benchmarks", "xtask"]

[dev-dependencies]
divan = "0.1.1"
expect-test = "1.4.1"
hex = "0.4.3"
hex-literal = "0.4.1"
proptest = "1.3.1"
rand = "0.8.5"

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

[package.metadata.docs.rs]
all-features = true

Expand Down
15 changes: 15 additions & 0 deletions benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "benchmarks"
version = "0.0.0"
publish = false
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
divan = "0.1.1"
lockstitch = { path = ".." }

[[bench]]
name = "benchmarks"
harness = false
File renamed without changes.
3 changes: 2 additions & 1 deletion xtask/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "xtask"
version = "0.1.0"
version = "0.0.0"
publish = false
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion xtask/src/xtask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fn bench(sh: &Shell, args: Vec<String>) -> Result<()> {
#[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))]
const RUSTFLAGS: &str = "";

cmd!(sh, "cargo bench {args...}")
cmd!(sh, "cargo bench -p benchmarks {args...}")
.env("RUSTFLAGS", RUSTFLAGS)
.env("DIVAN_BYTES_FORMAT", "binary")
.env("DIVAN_TIMER", "tsc")
Expand Down

0 comments on commit 517d6e8

Please sign in to comment.