5 RUN_BENCH
="sudo ./bench -w3 -d10 -a"
9 echo "$*" |
sed -E "s/.*hits\s+([0-9]+\.[0-9]+ ± [0-9]+\.[0-9]+M\/s).*/\1/"
14 echo "$*" |
sed -E "s/.*drops\s+([0-9]+\.[0-9]+ ± [0-9]+\.[0-9]+M\/s).*/\1/"
22 for i
in $
(seq 1 $len); do printf '='; done
29 summary
=$
(echo $2 |
tail -n1)
30 printf "%-20s %s (drops %s)\n" "$bench" "$(hits $summary)" "$(drops $summary)"
33 header
"Single-producer, parallel producer"
34 for b
in rb-libbpf rb-custom pb-libbpf pb-custom
; do
35 summarize
$b "$($RUN_BENCH $b)"
38 header
"Single-producer, parallel producer, sampled notification"
39 for b
in rb-libbpf rb-custom pb-libbpf pb-custom
; do
40 summarize
$b "$($RUN_BENCH --rb-sampled $b)"
43 header
"Single-producer, back-to-back mode"
44 for b
in rb-libbpf rb-custom pb-libbpf pb-custom
; do
45 summarize
$b "$($RUN_BENCH --rb-b2b $b)"
46 summarize
$b-sampled "$($RUN_BENCH --rb-sampled --rb-b2b $b)"
49 header
"Ringbuf back-to-back, effect of sample rate"
50 for b
in 1 5 10 25 50 100 250 500 1000 2000 3000; do
51 summarize
"rb-sampled-$b" "$($RUN_BENCH --rb-b2b --rb-batch-cnt $b --rb-sampled --rb-sample-rate $b rb-custom)"
53 header
"Perfbuf back-to-back, effect of sample rate"
54 for b
in 1 5 10 25 50 100 250 500 1000 2000 3000; do
55 summarize
"pb-sampled-$b" "$($RUN_BENCH --rb-b2b --rb-batch-cnt $b --rb-sampled --rb-sample-rate $b pb-custom)"
58 header
"Ringbuf back-to-back, reserve+commit vs output"
59 summarize
"reserve" "$($RUN_BENCH --rb-b2b rb-custom)"
60 summarize
"output" "$($RUN_BENCH --rb-b2b --rb-use-output rb-custom)"
62 header
"Ringbuf sampled, reserve+commit vs output"
63 summarize
"reserve-sampled" "$($RUN_BENCH --rb-sampled rb-custom)"
64 summarize
"output-sampled" "$($RUN_BENCH --rb-sampled --rb-use-output rb-custom)"
66 header
"Single-producer, consumer/producer competing on the same CPU, low batch count"
67 for b
in rb-libbpf rb-custom pb-libbpf pb-custom
; do
68 summarize
$b "$($RUN_BENCH --rb-batch-cnt 1 --rb-sample-rate 1 --prod-affinity 0 --cons-affinity 0 $b)"
71 header
"Ringbuf, multi-producer contention"
72 for b
in 1 2 3 4 8 12 16 20 24 28 32 36 40 44 48 52; do
73 summarize
"rb-libbpf nr_prod $b" "$($RUN_BENCH -p$b --rb-batch-cnt 50 rb-libbpf)"