Skip to content

Commit

Permalink
examples: add latency examples; update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdroychan committed Jul 29, 2024
1 parent f6e92d3 commit d0b3958
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 3 deletions.
12 changes: 12 additions & 0 deletions examples/latency/README.md
Original file line number Diff line number Diff line change
@@ -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)
Binary file added examples/latency/latency-readpopular.pdf
Binary file not shown.
Binary file added examples/latency/latency-readpopular.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/latency/latency-writeheavy.pdf
Binary file not shown.
Binary file added examples/latency/latency-writeheavy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 74 additions & 0 deletions examples/latency/plot.gpl
Original file line number Diff line number Diff line change
@@ -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"
23 changes: 23 additions & 0 deletions examples/latency/run.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion examples/mixed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion examples/readpopular/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion examples/writeheavy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit d0b3958

Please sign in to comment.