Re: [RFC]Routes are stored as a linked list
Donald Sharp
Mon Mar 04 15:31:28 2019
Roy -
Things look much better( even better than my initial swag at it )
Install/remove 1million routes:
sharpd@janelle:~$ ps -ef | grep dhcpcd
root 26445 1 15 15:27 ? 00:00:23 dhcpcd/src/dhcpcd
sharpd 26469 26377 0 15:30 pts/4 00:00:00 grep dhcpcd
sharpd@janelle:~$
Thanks for taking this up and fixing it. Huge improvement in runtime!
donald
On Mon, Mar 4, 2019 at 10:16 AM Roy Marples <roy@xxxxxxxxxxxx> wrote:
>
> 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