From cdb1bff49a0fee4ac39d0c6a2dad4ffdddcb17db Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Tue, 16 Apr 2019 22:17:57 +0200 Subject: [PATCH] Test: raised iteration counts for some benchmarks --- filter/trie_test.c | 4 +++- lib/tindex_test.c | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/filter/trie_test.c b/filter/trie_test.c index 7529a5c5..d43cd37e 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 c916480d..48f591a7 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); }