]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Test: raised iteration counts for some benchmarks
authorMaria Matejka <mq@jmq.cz>
Tue, 16 Apr 2019 20:17:57 +0000 (22:17 +0200)
committerMaria Matejka <mq@jmq.cz>
Tue, 16 Apr 2019 20:17:57 +0000 (22:17 +0200)
filter/trie_test.c
lib/tindex_test.c

index 7529a5c5aa01d18df9e37c71a9a62b21e9374c83..d43cd37e7382e6497f4d2ff68f7cd7fc189d82cf 100644 (file)
@@ -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();
 
index c916480d2575ba16ee04ce811324e5a22a74078a..48f591a7cda6eb1229485a901eb00aeda948042d 100644 (file)
@@ -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);
   }