0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-23 02:01:55 +00:00

Test: raised iteration counts for some benchmarks

This commit is contained in:
Maria Matejka 2019-04-16 22:17:57 +02:00
parent dc9297b712
commit cdb1bff49a
2 changed files with 7 additions and 3 deletions

View File

@ -14,6 +14,7 @@
#define TESTS_NUM 10 #define TESTS_NUM 10
#define PREFIXES_NUM 10 #define PREFIXES_NUM 10
#define BENCHMARK_MUL 10
#define PREFIX_TESTS_NUM 10000 #define PREFIX_TESTS_NUM 10000
#define BIG_BUFFER_SIZE 10000 #define BIG_BUFFER_SIZE 10000
@ -79,7 +80,8 @@ static void
generate_random_ipv6_prefixes(list *prefixes) generate_random_ipv6_prefixes(list *prefixes)
{ {
int i; 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(); struct f_prefix f = get_random_ip6_prefix();

View File

@ -65,14 +65,16 @@ t_simple(void)
.len = 256, .len = 256,
}; };
const u64 max = bt_benchmark ? (1<<19) : (1<<16);
bt_assert(tt.ti); 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); bt_debug("Trie add: %lu\n", i);
test_trie_add(&tt, i); test_trie_add(&tt, i);
test_trie_add(&tt, i * mul + add); 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, 1);
test_trie_get(&tt, i * mul + add, 1); test_trie_get(&tt, i * mul + add, 1);
} }