summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2023-01-02 15:55:55 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2023-01-02 15:55:55 +0100
commitd3f50ede127df338f575e188566035b2a46cf6c6 (patch)
tree8560a05ed8d35746a91a252e98ee212c722866b0 /filter
parent6d1ae197d189d50e60279796441c6e74272ddc54 (diff)
Add compile-time option to enable 4-way tries instead of 16-way ones
In some cases 16-way tries are too memory-heavy, while 4-way are almost as efficient as the original 2-way ones.
Diffstat (limited to 'filter')
-rw-r--r--filter/data.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/filter/data.h b/filter/data.h
index 051f0932..5edeaedb 100644
--- a/filter/data.h
+++ b/filter/data.h
@@ -141,8 +141,15 @@ struct f_tree {
void *data;
};
+#ifdef ENABLE_COMPACT_TRIES
+/* Compact 4-way tries */
+#define TRIE_STEP 2
+#define TRIE_STACK_LENGTH 65
+#else
+/* Faster 16-way tries */
#define TRIE_STEP 4
#define TRIE_STACK_LENGTH 33
+#endif
struct f_trie_node4
{