From: Maria Matejka Date: Tue, 16 Apr 2019 20:17:57 +0000 (+0200) Subject: Test: raised iteration counts for some benchmarks X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdb1bff49a0fee4ac39d0c6a2dad4ffdddcb17db;p=thirdparty%2Fbird.git Test: raised iteration counts for some benchmarks --- diff --git a/filter/trie_test.c b/filter/trie_test.c index 7529a5c5a..d43cd37e7 100644 --- a/filter/trie_test.c +++ b/filter/trie_test.c @@ -14,6 +14,7 @@ #define TESTS_NUM 10 #define PREFIXES_NUM 10 +#define BENCHMARK_MUL 10 #define PREFIX_TESTS_NUM 10000 #define BIG_BUFFER_SIZE 10000 @@ -79,7 +80,8 @@ static void generate_random_ipv6_prefixes(list *prefixes) { int i; - for (i = 0; i < PREFIXES_NUM; i++) + const int max = PREFIXES_NUM * (bt_benchmark ? BENCHMARK_MUL : 1); + for (i = 0; i < max; i++) { struct f_prefix f = get_random_ip6_prefix(); diff --git a/lib/tindex_test.c b/lib/tindex_test.c index c916480d2..48f591a7c 100644 --- a/lib/tindex_test.c +++ b/lib/tindex_test.c @@ -64,15 +64,17 @@ t_simple(void) .data = mb_allocz(p, sizeof(u64) * 256), .len = 256, }; + + const u64 max = bt_benchmark ? (1<<19) : (1<<16); bt_assert(tt.ti); - for (u64 i = 0; i < (1<<16); i++) { + for (u64 i = 0; i < max; i++) { bt_debug("Trie add: %lu\n", i); test_trie_add(&tt, i); test_trie_add(&tt, i * mul + add); } - for (u64 i = 0; i < (1<<16); i++) { + for (u64 i = 0; i < max; i++) { test_trie_get(&tt, i, 1); test_trie_get(&tt, i * mul + add, 1); }