Skip to content

Commit

Permalink
Reduce benchmarks speed
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeder committed Nov 25, 2024
1 parent cbbeeab commit 40dbbd5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors = ["Leonid Beder <leonid@lbeder.com>"]
edition = "2021"
name = "slowkey"
version = "1.5.9"
version = "1.6.0"

[dependencies]
base64 = "0.21.7"
Expand Down
4 changes: 1 addition & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -837,9 +837,7 @@ fn main() {
Some(Commands::Bench {}) => {
let output_path = env::current_dir().unwrap().join(BENCHMARKS_DIRECTORY);

let mut criterion = Criterion::default()
.output_directory(&output_path)
.measurement_time(Duration::new(60, 0));
let mut criterion = Criterion::default().output_directory(&output_path).sample_size(50);

SlowKey::benchmark(&mut criterion);

Expand Down
8 changes: 4 additions & 4 deletions src/slowkey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ impl SlowKey {
});
});

for options in [ScryptOptions::new(1 << 15, 8, 1), ScryptOptions::new(1 << 17, 8, 2)] {
for options in [ScryptOptions::new(1 << 10, 8, 1), ScryptOptions::new(1 << 12, 8, 2)] {
c.bench_with_input(
BenchmarkId::new(
"Scrypt",
Expand All @@ -260,7 +260,7 @@ impl SlowKey {
);
}

for options in [Argon2idOptions::new(1 << 15, 2), Argon2idOptions::new(1 << 17, 4)] {
for options in [Argon2idOptions::new(1 << 10, 2), Argon2idOptions::new(1 << 11, 4)] {
c.bench_with_input(
BenchmarkId::new(
"Argon2id",
Expand All @@ -278,8 +278,8 @@ impl SlowKey {
let options = SlowKeyOptions {
iterations: 10,
length: 32,
scrypt: ScryptOptions::new(1 << 12, 8, 1),
argon2id: Argon2idOptions::new(1 << 12, 2),
scrypt: ScryptOptions::new(1 << 10, 8, 1),
argon2id: Argon2idOptions::new(1 << 10, 2),
};

c.bench_with_input(
Expand Down

0 comments on commit 40dbbd5

Please sign in to comment.