]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Select more limited range of masks.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 17 Sep 2014 16:37:09 +0000 (17:37 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 17 Sep 2014 16:37:09 +0000 (17:37 +0100)
test/rspamd_radix_test.c

index 754e79dbf17c470d2bcb9a2b3bc29f17f4ddbceb..389e6f523c5ac9523675bd6ff5c7d798cdc246f2 100644 (file)
 #include "radix.h"
 #include "ottery.h"
 
-const gsize max_elts = 3 * 1024 * 1024;
+const gsize max_elts = 1 * 1024 * 1024;
+
+const uint masks[] = {
+               8,
+               16,
+               24,
+               32,
+               27
+};
 
 struct _tv {
        const char *ip;
@@ -129,7 +137,7 @@ rspamd_radix_test_func (void)
 
        for (i = 0; i < nelts; i ++) {
                addrs[i].addr = ottery_rand_uint32 ();
-               addrs[i].mask = ottery_rand_range (32);
+               addrs[i].mask = masks[ottery_rand_range(G_N_ELEMENTS (masks) - 1)];
        }
 
        msg_info ("old radix performance (%z elts)", nelts);