diff --git a/examples/latency/README.md b/examples/latency/README.md new file mode 100644 index 0000000..bfe15e2 --- /dev/null +++ b/examples/latency/README.md @@ -0,0 +1,12 @@ +This example shows the latency measurement of the [writeheavy](../writeheavy/) +and [readpopular](../readpopular/) examples. Their descriptions can be found in their own +directories. + +AMD Ryzen 9 5950X CPU 0-15 results (writeheavy, [pdf](latency-writeheavy.pdf)): + +![latency-writeheavy](latency-writeheavy.png) + + +AMD Ryzen 9 5950X CPU 0-15 results (readpopular, [pdf](latency-readpopular.pdf)): + +![latency-readpopular](latency-readpopular.png) diff --git a/examples/latency/latency-readpopular.pdf b/examples/latency/latency-readpopular.pdf new file mode 100644 index 0000000..df41344 Binary files /dev/null and b/examples/latency/latency-readpopular.pdf differ diff --git a/examples/latency/latency-readpopular.png b/examples/latency/latency-readpopular.png new file mode 100644 index 0000000..50b6a21 Binary files /dev/null and b/examples/latency/latency-readpopular.png differ diff --git a/examples/latency/latency-writeheavy.pdf b/examples/latency/latency-writeheavy.pdf new file mode 100644 index 0000000..b80cf90 Binary files /dev/null and b/examples/latency/latency-writeheavy.pdf differ diff --git a/examples/latency/latency-writeheavy.png b/examples/latency/latency-writeheavy.png new file mode 100644 index 0000000..43a5b6b Binary files /dev/null and b/examples/latency/latency-writeheavy.png differ diff --git a/examples/latency/plot.gpl b/examples/latency/plot.gpl new file mode 100644 index 0000000..23cf765 --- /dev/null +++ b/examples/latency/plot.gpl @@ -0,0 +1,74 @@ +set terminal pdf size 10,3 +set xlabel "Threads" +set key left top + +set output "latency-writeheavy.pdf" +set multiplot layout 1,3 +set ylabel "Average Latency (ns)" +plot [0:17] [0:] \ + "chashmap-writeheavy.txt" using 2:20 with lp ti "chashmap",\ + "contrie-writeheavy.txt" using 2:20 with lp ti "contrie",\ + "dashmap-writeheavy.txt" using 2:20 with lp ti "dashmap",\ + "flurry-writeheavy.txt" using 2:20 with lp ti "flurry",\ + "papaya-writeheavy.txt" using 2:20 with lp ti "papaya",\ + "scchashmap-writeheavy.txt" using 2:20 with lp ti "scchashmap",\ + "mutex_hashmap-writeheavy.txt" using 2:20 with lp ti "mutexhashmap",\ + "rwlock_hashmap-writeheavy.txt" using 2:20 with lp ti "rwlockhashmap" + +set ylabel "P99 Latency (ns)" +plot [0:17] [0:] \ + "chashmap-writeheavy.txt" using 2:26 with lp ti "chashmap",\ + "contrie-writeheavy.txt" using 2:26 with lp ti "contrie",\ + "dashmap-writeheavy.txt" using 2:26 with lp ti "dashmap",\ + "flurry-writeheavy.txt" using 2:26 with lp ti "flurry",\ + "papaya-writeheavy.txt" using 2:26 with lp ti "papaya",\ + "scchashmap-writeheavy.txt" using 2:26 with lp ti "scchashmap",\ + "mutex_hashmap-writeheavy.txt" using 2:26 with lp ti "mutexhashmap",\ + "rwlock_hashmap-writeheavy.txt" using 2:26 with lp ti "rwlockhashmap" + +set ylabel "P999 Latency (ns)" +plot [0:17] [0:] \ + "chashmap-writeheavy.txt" using 2:28 with lp ti "chashmap",\ + "contrie-writeheavy.txt" using 2:28 with lp ti "contrie",\ + "dashmap-writeheavy.txt" using 2:28 with lp ti "dashmap",\ + "flurry-writeheavy.txt" using 2:28 with lp ti "flurry",\ + "papaya-writeheavy.txt" using 2:28 with lp ti "papaya",\ + "scchashmap-writeheavy.txt" using 2:28 with lp ti "scchashmap",\ + "mutex_hashmap-writeheavy.txt" using 2:28 with lp ti "mutexhashmap",\ + "rwlock_hashmap-writeheavy.txt" using 2:28 with lp ti "rwlockhashmap" + +unset multiplot +set output "latency-readpopular.pdf" +set multiplot layout 1,3 +set ylabel "Average Latency (ns)" +plot [0:17] [0:] \ + "chashmap-readpopular.txt" using 2:20 with lp ti "chashmap",\ + "contrie-readpopular.txt" using 2:20 with lp ti "contrie",\ + "dashmap-readpopular.txt" using 2:20 with lp ti "dashmap",\ + "flurry-readpopular.txt" using 2:20 with lp ti "flurry",\ + "papaya-readpopular.txt" using 2:20 with lp ti "papaya",\ + "scchashmap-readpopular.txt" using 2:20 with lp ti "scchashmap",\ + "mutex_hashmap-readpopular.txt" using 2:20 with lp ti "mutexhashmap",\ + "rwlock_hashmap-readpopular.txt" using 2:20 with lp ti "rwlockhashmap" + +set ylabel "P99 Latency (ns)" +plot [0:17] [0:] \ + "chashmap-readpopular.txt" using 2:26 with lp ti "chashmap",\ + "contrie-readpopular.txt" using 2:26 with lp ti "contrie",\ + "dashmap-readpopular.txt" using 2:26 with lp ti "dashmap",\ + "flurry-readpopular.txt" using 2:26 with lp ti "flurry",\ + "papaya-readpopular.txt" using 2:26 with lp ti "papaya",\ + "scchashmap-readpopular.txt" using 2:26 with lp ti "scchashmap",\ + "mutex_hashmap-readpopular.txt" using 2:26 with lp ti "mutexhashmap",\ + "rwlock_hashmap-readpopular.txt" using 2:26 with lp ti "rwlockhashmap" + +set ylabel "P999 Latency (ns)" +plot [0:17] [0:] \ + "chashmap-readpopular.txt" using 2:28 with lp ti "chashmap",\ + "contrie-readpopular.txt" using 2:28 with lp ti "contrie",\ + "dashmap-readpopular.txt" using 2:28 with lp ti "dashmap",\ + "flurry-readpopular.txt" using 2:28 with lp ti "flurry",\ + "papaya-readpopular.txt" using 2:28 with lp ti "papaya",\ + "scchashmap-readpopular.txt" using 2:28 with lp ti "scchashmap",\ + "mutex_hashmap-readpopular.txt" using 2:28 with lp ti "mutexhashmap",\ + "rwlock_hashmap-readpopular.txt" using 2:28 with lp ti "rwlockhashmap" diff --git a/examples/latency/run.sh b/examples/latency/run.sh new file mode 100755 index 0000000..1a8ced6 --- /dev/null +++ b/examples/latency/run.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" + +cargo +stable build --profile release-lto --all-features + +STORE_DIR=$DIR/../../presets/stores + +STORES="chashmap contrie dashmap flurry papaya scchashmap mutex_hashmap rwlock_hashmap" + +for s in $STORES; do + for b in readpopular writeheavy; do + benchmark=$DIR/../$b/$b.toml + echo $s-$b + rm $s-$b.txt 2>/dev/null + for t in `seq 1 16`; do + data="$(env global.latency=true global.threads=$t cargo +stable run --profile release-lto --all-features -- bench -s $STORE_DIR/$s.toml -b $benchmark 2>/dev/null)" + echo "threads $t $data" | tee -a $s-$b.txt + done + done +done + +gnuplot $DIR/plot.gpl diff --git a/examples/mixed/README.md b/examples/mixed/README.md index 8f47e95..a6c97a3 100644 --- a/examples/mixed/README.md +++ b/examples/mixed/README.md @@ -68,6 +68,6 @@ The script file `run.sh` runs this benchmark against multiple stores with 32 thr Although the number of threads set in the configuration file is only 1, the number of threads are dynamically adjusted by setting `global.threads` to 32. -5950X CPU 0-15 results ([pdf](mixed.pdf)): +AMD Ryzen 9 5950X CPU 0-15 results ([pdf](mixed.pdf)): ![mixed](mixed.png) diff --git a/examples/readpopular/README.md b/examples/readpopular/README.md index 90efc5b..16a0102 100644 --- a/examples/readpopular/README.md +++ b/examples/readpopular/README.md @@ -37,6 +37,6 @@ In the second phase, worker threads execute the read-only workload that accesses The script file `run.sh` runs this benchmark against multiple stores with different number of threads. The number of threads are dynamically adjusted via `global.threads` environment variable. -5950X CPU 0-15 results ([pdf](readpopular.pdf)): +AMD Ryzen 9 5950X CPU 0-15 results ([pdf](readpopular.pdf)): ![readpopular](readpopular.png) diff --git a/examples/writeheavy/README.md b/examples/writeheavy/README.md index eb43ea9..64a8ee1 100644 --- a/examples/writeheavy/README.md +++ b/examples/writeheavy/README.md @@ -36,6 +36,6 @@ when finished. The script file `run.sh` runs this benchmark against multiple stores with different number of threads. The number of threads are dynamically adjusted via `global.threads` environment variable. -5950X CPU 0-15 results ([pdf](writeheavy.pdf)): +AMD Ryzen 9 5950X CPU 0-15 results ([pdf](writeheavy.pdf)): ![writeheavy](writeheavy.png)