Skip to content

Commit

Permalink
Merge pull request #104 from nvzqz/patch-1
Browse files Browse the repository at this point in the history
refactor: Use runtime arguments in Divan benchmarks
  • Loading branch information
Aloso authored Jan 25, 2024
2 parents 03d3090 + 7cb124c commit e3fa50f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 30 deletions.
31 changes: 6 additions & 25 deletions 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 benchmark/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ publish = false

[dependencies]
pomsky = { version = "0.11.0", path = "../pomsky-lib" }
divan = "0.1.2"
divan = "0.1.11"
melody_compiler = "0.19.0"

[[bench]]
Expand Down
8 changes: 4 additions & 4 deletions benchmark/benches/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ mod compile {
);
}

#[divan::bench(consts = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13])]
pub fn range<const N: usize>(bencher: divan::Bencher) {
let max = "3458709621".repeat((N + 9) / 10);
let max = &max[..N];
#[divan::bench(args = 1..=13)]
pub fn range(bencher: divan::Bencher, n: usize) {
let max = "3458709621".repeat((n + 9) / 10);
let max = &max[..n];
let input = format!("range '0'-'{max}'");

bencher
Expand Down

0 comments on commit e3fa50f

Please sign in to comment.