RE: [PATCH V2] tipc: Use bsearch library function

From: Jon Maloy
Date: Mon Sep 18 2017 - 21:09:09 EST




> -----Original Message-----
> From: netdev-owner@xxxxxxxxxxxxxxx [mailto:netdev-
> owner@xxxxxxxxxxxxxxx] On Behalf Of Joe Perches
> Sent: Sunday, September 17, 2017 23:15
> To: Jon Maloy <jon.maloy@xxxxxxxxxxxx>; Thomas Meyer
> <thomas@xxxxxxxx>
> Cc: Ying Xue <ying.xue@xxxxxxxxxxxxx>; netdev@xxxxxxxxxxxxxxx; tipc-
> discussion@xxxxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> davem@xxxxxxxxxxxxx
> Subject: Re: [PATCH V2] tipc: Use bsearch library function
>
> On Sun, 2017-09-17 at 16:27 +0000, Jon Maloy wrote:
> > > -----Original Message-----
> > > From: Thomas Meyer [mailto:thomas@xxxxxxxx]
> []
> > > What about the other binary search implementation in the same file?
> > > Should I try to convert it it will it get NAKed for performance reasons too?
> >
> > The searches for inserting and removing publications is less time
> > critical, so that would be ok with me.
> > If you have any more general interest in improving the code in this
> > file (which is needed) it would also be appreciated.
>
> Perhaps using an rbtree would be an improvement.

Not a bad idea. It would probably reduce the code amount, possibly at the expense of cache hit rate during the binary lookup.
It is worth looking into.

///jon