Re: [RFC]Routes are stored as a linked list
Roy Marples
Mon Mar 04 15:14:43 2019
On 04/03/2019 02:03, Donald Sharp wrote:
sharpd@janelle:~/dhcpcd$ ps -ef | grep dhcpcd
root 28135 1 26 01:49 ? 00:03:22 /home/sharpd/dhcpcd/src/dhcpcd
sharpd 28262 27679 0 02:02 pts/3 00:00:00 grep dhcpcd
sharpd@janelle:~/dhcpcd$
After 1 million routes installed/removed
So, slightly slower than the original TAILQ implementation.
Of course, I made a schoolboy error and didn't use the power of RB Tree
as you did in your initial patch - namely improve rt_find.
rt_find has now been replaced with rb_tree_find_node so will hopefully
see some nice improvement now.
I've also added checks to ensure we free the route if insertion fails -
this was probably the leak in your initial patch as there are no checks
for this.
I've also used this enforced uniqueness to avoid a needless lookup in
rt_recvrt when adding a new route.
Let me know how this works for you!
Roy
Archive administrator: postmaster@marples.name