1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Filter: Optimize IPv4 prefix sets

Use separate IPv4 and IPv6 implementation of prefix sets. Just this
change makes IPv4 prefix sets 60% smaller and 50% faster.
This commit is contained in:
Ondrej Zajicek (work)
2020-03-26 03:57:48 +01:00
parent d516c68ad8
commit 2755002890
5 changed files with 246 additions and 91 deletions

View File

@@ -2789,7 +2789,7 @@ rt_init_hostcache(rtable *tab)
hc->slab = sl_new(rt_table_pool, sizeof(struct hostentry));
hc->lp = lp_new(rt_table_pool, LP_GOOD_SIZE(1024));
hc->trie = f_new_trie(hc->lp, sizeof(struct f_trie_node));
hc->trie = f_new_trie(hc->lp, 0);
tab->hostcache = hc;
}
@@ -2943,7 +2943,7 @@ rt_update_hostcache(rtable *tab)
/* Reset the trie */
lp_flush(hc->lp);
hc->trie = f_new_trie(hc->lp, sizeof(struct f_trie_node));
hc->trie = f_new_trie(hc->lp, 0);
WALK_LIST_DELSAFE(n, x, hc->hostentries)
{