Skip to content

Commit

Permalink
Speed up the benchmarks. I don't need 60 seconds per run as the maxim…
Browse files Browse the repository at this point in the history
…um to get a rough idea about performance and/or perf regressions
  • Loading branch information
dfellis committed Nov 20, 2024
1 parent 6762b40 commit 6f9880b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions alan/benches/fill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ macro_rules! build {

macro_rules! run {
( $name:ident ) => {
#[divan::bench(max_time = 60)]
#[divan::bench(max_time = 10)]
fn $name() -> Result<Output, std::io::Error> {
Command::new(format!("./{}", stringify!($name))).output()
}
Expand Down Expand Up @@ -54,19 +54,19 @@ run!(t01_fill_100);
run!(t02_fill_100_000);
run!(t03_fill_100_000_000);

#[divan::bench(max_time = 60)]
#[divan::bench(max_time = 10)]
fn t04_vec_100() -> Result<(), std::io::Error> {
let v = vec![5; 100];
write("/dev/null", format!("{}", v[0]))
}

#[divan::bench(max_time = 60)]
#[divan::bench(max_time = 10)]
fn t05_vec_100_000() -> Result<(), std::io::Error> {
let v = vec![5; 100_000];
write("/dev/null", format!("{}", v[0]))
}

#[divan::bench(max_time = 60)]
#[divan::bench(max_time = 10)]
fn t06_vec_100_000_000() -> Result<(), std::io::Error> {
let v = vec![5; 100_000_000];
write("/dev/null", format!("{}", v[0]))
Expand Down
2 changes: 1 addition & 1 deletion alan/benches/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ macro_rules! build {

macro_rules! run {
( $name:ident ) => {
#[divan::bench(max_time = 60)]
#[divan::bench(max_time = 10)]
fn $name() -> Result<Output, std::io::Error> {
Command::new(format!("./{}", stringify!($name))).output()
}
Expand Down

0 comments on commit 6f9880b

Please sign in to comment.