Skip to content

Commit

Permalink
benchmark/ycsb: drop cache before measurement start
Browse files Browse the repository at this point in the history
  • Loading branch information
fia0 committed Jan 13, 2025
1 parent 16b48cc commit f4baeb0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions betree/haura-benchmarks/src/ycsb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ pub fn a(mut client: KvClient, size: u64, threads: usize, runtime: u64) {
)
})
.collect::<Vec<_>>();
client.db.read().drop_cache().unwrap();
let start = std::time::Instant::now();
for (_t, tx) in threads.iter() {
tx.send(start).unwrap();
Expand Down Expand Up @@ -161,6 +162,7 @@ pub fn b(mut client: KvClient, size: u64, threads: usize, runtime: u64) {
)
})
.collect::<Vec<_>>();
client.db.read().drop_cache().unwrap();
let start = std::time::Instant::now();
for (_t, tx) in threads.iter() {
tx.send(start).unwrap();
Expand Down Expand Up @@ -226,6 +228,7 @@ pub fn c(mut client: KvClient, size: u64, threads: usize, runtime: u64) {
)
})
.collect::<Vec<_>>();
client.db.read().drop_cache().unwrap();
let start = std::time::Instant::now();
for (_t, tx) in threads.iter() {
tx.send(start).unwrap();
Expand Down Expand Up @@ -324,6 +327,7 @@ pub fn d(mut client: KvClient, size: u64, threads: usize, runtime: u64) {
)
})
.collect::<Vec<_>>();
client.db.read().drop_cache().unwrap();
let start = std::time::Instant::now();
for (_t, tx) in threads.iter() {
tx.send(start).unwrap();
Expand Down Expand Up @@ -409,7 +413,7 @@ pub fn e(mut client: KvClient, size: u64, threads: usize, runtime: u64) {
let start_key = &keys[start_idx][..];
let end_key = &keys[end_idx][..];
// Consume the iterator to actually perform the scan
for _entry in ds.range(start_key..end_key).unwrap(){ }
for _entry in ds.range(start_key..end_key).unwrap() {}
} else {
// 5% inserts of new records
let current = current_size.load(AtomicOrdering::Relaxed);
Expand All @@ -428,7 +432,7 @@ pub fn e(mut client: KvClient, size: u64, threads: usize, runtime: u64) {
)
})
.collect::<Vec<_>>();

client.db.read().drop_cache().unwrap();
let start = std::time::Instant::now();
for (_t, tx) in threads.iter() {
tx.send(start).unwrap();
Expand Down Expand Up @@ -503,6 +507,7 @@ pub fn f(mut client: KvClient, size: u64, threads: usize, runtime: u64) {
)
})
.collect::<Vec<_>>();
client.db.read().drop_cache().unwrap();
let start = std::time::Instant::now();
for (_t, tx) in threads.iter() {
tx.send(start).unwrap();
Expand Down

0 comments on commit f4baeb0

Please sign in to comment.