diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-03-06 08:50:40 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-03-06 08:50:40 +0000 |
commit | 2658849a1fc6bfc88dfb9b45fcb49d26fa1d4331 (patch) | |
tree | 37dd7cd3a58da7f0722b16900aa47fa6734eeae6 /src/bin/benchmark-index.rs | |
parent | 983304dc338e3a28f2a9015d8fd4516bab0a2029 (diff) | |
parent | c908c0d31db0f729d2bc1c2f791f226c8b73fc22 (diff) | |
download | obnam2-2658849a1fc6bfc88dfb9b45fcb49d26fa1d4331.tar.gz |
Merge branch 'duration' into 'main'
perf: report wall clock time for warmup and hot lookups
See merge request larswirzenius/obnam!112
Diffstat (limited to 'src/bin/benchmark-index.rs')
-rw-r--r-- | src/bin/benchmark-index.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bin/benchmark-index.rs b/src/bin/benchmark-index.rs index 6a1dc13..9baa327 100644 --- a/src/bin/benchmark-index.rs +++ b/src/bin/benchmark-index.rs @@ -1,6 +1,7 @@ use obnam::benchmark::ChunkGenerator; use obnam::index::Index; use std::path::{Path, PathBuf}; +use std::time::SystemTime; use structopt::StructOpt; #[derive(Debug, StructOpt)] @@ -42,8 +43,13 @@ fn main() -> anyhow::Result<()> { hot_count, } => { let mut index = Index::new(chunks)?; + let time = SystemTime::now(); warmup(&mut index, warmup_count)?; + let warmup_time = time.elapsed()?; hot(&mut index, hot_count)?; + let hot_time = time.elapsed()? - warmup_time; + println!("warmup {}", warmup_time.as_millis()); + println!("hot {}", hot_time.as_millis()); } } |