From 2769ce1a09c5ef17cfdbe664104c18694d5bcf8b Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Tue, 3 Dec 2013 11:50:01 -0500 Subject: [PATCH] regressions/ck_hs: Add ck_hs tombstone stride workload to serial benchmark. This measures clustering effect of tombstones on average probe sequence length. --- regressions/ck_hs/benchmark/serial.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/regressions/ck_hs/benchmark/serial.c b/regressions/ck_hs/benchmark/serial.c index 08e2656..a121471 100644 --- a/regressions/ck_hs/benchmark/serial.c +++ b/regressions/ck_hs/benchmark/serial.c @@ -188,7 +188,7 @@ main(int argc, char *argv[]) char buffer[512]; size_t i, j, r; unsigned int d = 0; - uint64_t s, e, a, ri, si, ai, sr, rg, sg, ag, sd, ng, ss; + uint64_t s, e, a, ri, si, ai, sr, rg, sg, ag, sd, ng, ss, sts; struct ck_hs_stat st; char **t; @@ -236,7 +236,8 @@ main(int argc, char *argv[]) fprintf(stderr, "# %zu entries stored, %u duplicates, %u probe.\n", set_count(), d, st.probe_maximum); - fprintf(stderr, "# reverse_insertion serial_insertion random_insertion serial_swap serial_replace reverse_get serial_get random_get serial_remove negative_get\n\n"); + fprintf(stderr, "# reverse_insertion serial_insertion random_insertion serial_swap " + "serial_replace reverse_get serial_get random_get serial_remove negative_get tombstone\n\n"); a = 0; for (j = 0; j < r; j++) { @@ -371,6 +372,25 @@ main(int argc, char *argv[]) } ng = a / (r * keys_length); + set_reset(); + for (i = 0; i < keys_length; i++) + set_insert(keys[i]); + for (i = 0; i < keys_length; i++) + set_remove(keys[i]); + + a = 0; + for (j = 0; j < r; j++) { + s = rdtsc(); + for (i = 0; i < keys_length; i++) + set_insert(keys[i]); + e = rdtsc(); + a += e - s; + + for (i = 0; i < keys_length; i++) + set_remove(keys[i]); + } + sts = a / (r * keys_length); + printf("%zu " "%" PRIu64 " " "%" PRIu64 " " @@ -381,8 +401,9 @@ main(int argc, char *argv[]) "%" PRIu64 " " "%" PRIu64 " " "%" PRIu64 " " + "%" PRIu64 " " "%" PRIu64 "\n", - keys_length, ri, si, ai, ss, sr, rg, sg, ag, sd, ng); + keys_length, ri, si, ai, ss, sr, rg, sg, ag, sd, ng, sts); return 0; }