test: measure performance for KV store idea

main
_ 2021-01-03 19:55:45 +00:00
parent ce3342d961
commit 27f31d0ef4
2 changed files with 46 additions and 0 deletions

View File

@ -308,4 +308,38 @@ mod tests {
tuples: vec! [] tuples: vec! []
}); });
} }
#[test]
#[cfg (not (debug_assertions))]
fn perf () {
use std::time::Instant;
let s = Store::new (vec! [
(b"key_dir".to_vec (), StatusQuotas {
max_keys: 4,
max_key_bytes: 16,
max_value_bytes: 16,
max_payload_bytes: 128,
}),
].into_iter ());
let num_iters = 1_000_000;
let key = b"foo".to_vec ();
let start_time = Instant::now ();
for i in 0..num_iters {
let value = format! ("{}", i);
s.set (b"key_dir", key.clone (), value.into ());
}
let end_time = Instant::now ();
let total_dur = end_time - start_time;
let avg_nanos = total_dur.as_nanos () / num_iters;
assert! (avg_nanos < 200);
}
} }

12
docs/build-artifacts.md Normal file
View File

@ -0,0 +1,12 @@
# Build artifact log
## 2021-01Jan-03
Git commit 88e7839841ad812f5645a30503955511ac107bdd
Sizes:
- ptth_relay: 11 MB
- ptth_server: 14 MB
- ptth_relay gzipped: 3 MB
- ptth_server gzipped: 5 MB