aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/bpf/benchs/run_bench_bloom_filter_map.sh
blob: 8ffd385ab2f42c9d0d508312751f53f54f607132 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0

source ./benchs/run_common.sh

set -eufo pipefail

header "Bloom filter map"
for v in 2 4 8 16 40; do
for t in 1 4 8 12 16; do
for h in {1..10}; do
subtitle "value_size: $v bytes, # threads: $t, # hashes: $h"
	for e in 10000 50000 75000 100000 250000 500000 750000 1000000 2500000 5000000; do
		printf "%'d entries -\n" $e
		printf "\t"
		summarize "Lookups, total operations: " \
			"$($RUN_BENCH -p $t --nr_hash_funcs $h --nr_entries $e --value_size $v bloom-lookup)"
		printf "\t"
		summarize "Updates, total operations: " \
			"$($RUN_BENCH -p $t --nr_hash_funcs $h --nr_entries $e --value_size $v bloom-update)"
		printf "\t"
		summarize_percentage "False positive rate: " \
			"$($RUN_BENCH -p $t --nr_hash_funcs $h --nr_entries $e --value_size $v bloom-false-positive)"
	done
	printf "\n"
done
done
done

header "Hashmap without bloom filter vs. hashmap with bloom filter (throughput, 8 threads)"
for v in 2 4 8 16 40; do
for h in {1..10}; do
subtitle "value_size: $v, # hashes: $h"
	for e in 10000 50000 75000 100000 250000 500000 750000 1000000 2500000 5000000; do
		printf "%'d entries -\n" $e
		printf "\t"
		summarize_total "Hashmap without bloom filter: " \
			"$($RUN_BENCH --nr_hash_funcs $h --nr_entries $e --value_size $v -p 8 hashmap-without-bloom)"
		printf "\t"
		summarize_total "Hashmap with bloom filter: " \
			"$($RUN_BENCH --nr_hash_funcs $h --nr_entries $e --value_size $v -p 8 hashmap-with-bloom)"
	done
	printf "\n"
done
done