Re: strncmp->memcmp when we know the shorter length

Поиск
Список
Период
Сортировка
От Noah Misch
Тема Re: strncmp->memcmp when we know the shorter length
Дата
Msg-id 20101222181951.GA1325@tornado.leadboat.com
обсуждение исходный текст
Ответ на Re: strncmp->memcmp when we know the shorter length  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Tue, Dec 21, 2010 at 10:15:41PM -0500, Robert Haas wrote:
> A little benchmarking reveals that on my system (MacOS X 10.6.5) it
> appears that strncmp() is faster for a 4 character string, but
> memcmp() is faster for a 5+ character string.

Good call; I hadn't considered that possibility.

> So I think most of
> these are pretty clear wins, but I have reverted the changes to
> src/backend/tsearch because I'm not entirely confident that lexemes
> and affixes will be long enough on average for this to be a win there.
>  Please feel free to resubmit that part with performance results
> showing that it works out to a win.  Some of the ltree changes
> produced compiler warnings, so I omitted those also.  Committed the
> rest.

Thanks for the quick review and commit.  I'm not acquainted with the performance
significance of the tsearch and ltree call sites.  Leaving those as-is makes
sense to me.

nm


В списке pgsql-hackers по дате отправления:

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: How much do the hint bits help?
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Re: plperlu problem with utf8