Re: [PATCH] backend: compare word-at-a-time in bcTruelen

Поиск
Список
Период
Сортировка
От Jeremy Kerr
Тема Re: [PATCH] backend: compare word-at-a-time in bcTruelen
Дата
Msg-id 200906262047.00727.jk@ozlabs.org
обсуждение исходный текст
Ответ на Re: [PATCH] backend: compare word-at-a-time in bcTruelen  (Stephen Frost <sfrost@snowman.net>)
Ответы Re: [PATCH] backend: compare word-at-a-time in bcTruelen  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [PATCH] backend: compare word-at-a-time in bcTruelen  (Dimitri Fontaine <dfontaine@hi-media.com>)
Список pgsql-hackers
Stephen,

> If the updated function is always faster when the overall string is at
> least, say, 16 characters long,

But that's not the case - the cost of the function (and the speedup from 
the previous version) depends on the number of spaces that there are at 
the end.

For the new function to be faster, we need to know that there are more 
than 6 (on average, depending on alignment) trailing spaces. The number 
of non-space characters in the string won't affect performance (other 
than that there is probably a correlation between total string length 
and number of spaces, but we can't be certain of that).

> If the new function is always slower, regardless of overall string
> length, when there's only 1 extra space at the end

Yes, that is correct.

Cheers,


Jeremy



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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: [PATCH] backend: compare word-at-a-time in bcTruelen
Следующее
От: Tom Lane
Дата:
Сообщение: gettext version problem exposed by buildfarm failures on "canary"