Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1733239

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

From Ying Xue <ying.xue@windriver.com>
Newsgroups linux.kernel
Subject Re: [PATCH V2] tipc: Use bsearch library function
Date 2017-09-16 12:20 +0200
Message-ID <uqimB-78-3@gated-at.bofh.it> (permalink)
References (1 earlier) <uqgb7-6Vu-7@gated-at.bofh.it> <uqhgS-7Sx-7@gated-at.bofh.it> <uqhAd-809-5@gated-at.bofh.it> <uqhJU-845-19@gated-at.bofh.it> <uqi3f-8c3-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 09/16/2017 05:58 PM, Joe Perches wrote:
> 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.
> 

Right, but probably we can tolerate the slight sacrifice here.

> 

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] tipc: Use bsearch library function Thomas Meyer <thomas@m3y3r.de> - 2017-09-11 15:20 +0200
  Re: [PATCH] tipc: Use bsearch library function David Miller <davem@davemloft.net> - 2017-09-11 23:40 +0200
    RE: [PATCH] tipc: Use bsearch library function David Laight <David.Laight@ACULAB.COM> - 2017-09-12 11:30 +0200
    [PATCH V2] tipc: Use bsearch library function Thomas Meyer <thomas@m3y3r.de> - 2017-09-16 10:00 +0200
      Re: [PATCH V2] tipc: Use bsearch library function Ying Xue <ying.xue@windriver.com> - 2017-09-16 11:10 +0200
        Re: [PATCH V2] tipc: Use bsearch library function Joe Perches <joe@perches.com> - 2017-09-16 11:30 +0200
          Re: [PATCH V2] tipc: Use bsearch library function Ying Xue <ying.xue@windriver.com> - 2017-09-16 11:40 +0200
            Re: [PATCH V2] tipc: Use bsearch library function Joe Perches <joe@perches.com> - 2017-09-16 12:00 +0200
              Re: [PATCH V2] tipc: Use bsearch library function Joe Perches <joe@perches.com> - 2017-09-16 12:20 +0200
                Re: [PATCH V2] tipc: Use bsearch library function Thomas Meyer <thomas@m3y3r.de> - 2017-09-17 17:10 +0200
                Re: [PATCH V2] tipc: Use bsearch library function Joe Perches <joe@perches.com> - 2017-09-17 23:20 +0200
              Re: [PATCH V2] tipc: Use bsearch library function Ying Xue <ying.xue@windriver.com> - 2017-09-16 12:20 +0200

csiph-web