summaryrefslogtreecommitdiffstats
path: root/lib/plist_int.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-03-09 02:52:45 +0100
committerDonald Sharp <sharpd@nvidia.com>2022-03-11 20:18:13 +0100
commite92508a741e03b8721ccb3424cbebe4d5476e9d0 (patch)
tree25dc75ca3adc00fc302536d71fea67069d3549f0 /lib/plist_int.h
parentMerge pull request #10774 from opensourcerouting/pim6-fixes-20220311 (diff)
downloadfrr-e92508a741e03b8721ccb3424cbebe4d5476e9d0.tar.xz
frr-e92508a741e03b8721ccb3424cbebe4d5476e9d0.zip
lib: Convert prefix_master->str to a RB Tree
The prefix_master->str data structure was a sorted list of the prefix names. Not that big of a deal other than insertion and deletion is insanely expensive when you have a large number of unique prefix-lists. In my test config file that I discovered this, I have 587 unique prefix lists spread out acros ~26k lines of prefix-lists. When reading this config file into FRR the read time goes from 690 seconds to 650 seconds. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib/plist_int.h')
-rw-r--r--lib/plist_int.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/plist_int.h b/lib/plist_int.h
index 571978a51..397557b37 100644
--- a/lib/plist_int.h
+++ b/lib/plist_int.h
@@ -28,6 +28,8 @@ extern "C" {
struct pltrie_table;
+PREDECL_RBTREE_UNIQ(plist);
+
struct prefix_list {
char *name;
char *desc;
@@ -37,13 +39,12 @@ struct prefix_list {
int count;
int rangecount;
+ struct plist_item plist_item;
+
struct prefix_list_entry *head;
struct prefix_list_entry *tail;
struct pltrie_table *trie;
-
- struct prefix_list *next;
- struct prefix_list *prev;
};
/* Each prefix-list's entry. */