]> git.puffer.fish Git - mirror/frr.git/commit
ldpd: use red-black trees to store 'lde_map' elements
authorRenato Westphal <renato@opensourcerouting.org>
Sat, 3 Dec 2016 23:14:44 +0000 (21:14 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Wed, 15 Feb 2017 09:19:52 +0000 (07:19 -0200)
commit9b127e580474f6a075046f81d3228d3ed29421b3
tree092f80782a8a6b2896ad71b07b4deafeaa0bd337
parent50c2e7c36d18c5359c12d8ab5cc6446394de9b73
ldpd: use red-black trees to store 'lde_map' elements

Using red-black trees instead of linked lists brings the following
benefits:
1 - Elements are naturally ordered (no need to reorder anything before
    outputting data to the user);
2 - Faster lookups/deletes: O(log n) time complexity against O(n).

The insert operation with red-black trees is more expensive though,
but that's not a big issue since lookups are much more frequent.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ldpd/l2vpn.c
ldpd/lde.c
ldpd/lde.h
ldpd/lde_lib.c