mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 17:51:53 +00:00
Test: raised iteration counts for some benchmarks
This commit is contained in:
parent
dc9297b712
commit
cdb1bff49a
@ -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();
|
||||||
|
|
||||||
|
@ -64,15 +64,17 @@ t_simple(void)
|
|||||||
.data = mb_allocz(p, sizeof(u64) * 256),
|
.data = mb_allocz(p, sizeof(u64) * 256),
|
||||||
.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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user