The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Ying Xue <ying.xue@windriver.com>, Thomas Meyer <thomas@m3y3r.de>,
	jon.maloy@ericsson.com, netdev@vger.kernel.org,
	tipc-discussion@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH V2] tipc: Use bsearch library function
Date: Sat, 16 Sep 2017 02:58:28 -0700	[thread overview]
Message-ID: <1505555908.16316.5.camel@perches.com> (raw)
In-Reply-To: <64ee51ce-eb7e-ac1c-56a9-9481f6f80b35@windriver.com>

On Sat, 2017-09-16 at 17:36 +0800, Ying Xue wrote:
> On 09/16/2017 05:26 PM, Joe Perches wrote:
> > On Sat, 2017-09-16 at 17:02 +0800, Ying Xue wrote:
> > > On 09/16/2017 03:50 PM, Thomas Meyer wrote:
> > > > Use common library function rather than explicitly coding
> > > > some variant of it yourself.
> > > > 
> > > > Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
> > > 
> > > Acked-by: Ying Xue <ying.xue@windriver.com>
> > 
> > Are you sure you want to do this?
> > 
> > Note the comment above nameseq_find_subseq
> > 
> >  * Very time-critical, so binary searches through sub-sequence array.
> > 
> > What impact does this change have on performance?
> 
> Sorry, I couldn't see any essential difference between this new
> implementation and the original one except that the former tries to use
> the library function - bsearch() to replace the original binary search
> algorithm implemented in TIPC itself. Therefore, I don't think the
> change will have a big impact on performance.
> 
> If I miss something, please let me know.

Comparison via a function pointer in bsearch is slower
than direct code without the function call overhead.

  reply	other threads:[~2017-09-16  9:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-09  3:18 [PATCH] tipc: Use bsearch library function Thomas Meyer
2017-09-11 21:30 ` David Miller
2017-09-12  9:24   ` David Laight
2017-09-16  7:50   ` [PATCH V2] " Thomas Meyer
2017-09-16  9:02     ` Ying Xue
2017-09-16  9:26       ` Joe Perches
2017-09-16  9:36         ` Ying Xue
2017-09-16  9:58           ` Joe Perches [this message]
2017-09-16 10:10             ` Ying Xue
2017-09-16 10:17               ` Joe Perches
2017-09-16 13:20                 ` Jon Maloy
2017-09-17 15:00                   ` Thomas Meyer
2017-09-17 16:27                     ` Jon Maloy
2017-09-17 21:15                       ` Joe Perches
2017-09-19  1:08                         ` Jon Maloy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1505555908.16316.5.camel@perches.com \
    --to=joe@perches.com \
    --cc=davem@davemloft.net \
    --cc=jon.maloy@ericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=thomas@m3y3r.de \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=ying.xue@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox