Re: [PATCH] Custom code int(32|64) => text conversions out of performance reasons

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] Custom code int(32|64) => text conversions out of performance reasons
Дата
Msg-id 3389.1290284480@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCH] Custom code int(32|64) => text conversions out of performance reasons  (Greg Stark <gsstark@mit.edu>)
Список pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:
> On Sat, Nov 20, 2010 at 6:31 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Robert Haas <robertmhaas@gmail.com> writes:
>>> I had given some thought to whether it might make sense to try to
>>> figure out how long the string will be before we actually start
>>> generating it, so that we can just start in the exactly right space
>>> and have to clean up afterward. �But the obvious implementation seems
>>> like it could be more expensive than just doing the copy.

>> Yeah. �You certainly don't want to do the division sequence twice,
>> and a log() call wouldn't be cheap either, and there don't seem to
>> be many other alternatives.

> There are bittwiddling hacks for computing log based 2. I'm not sure
> it's worth worrying about to this degree though.

I think converting log2 to log10 *exactly* would end up being not so
cheap, anyhow.
        regards, tom lane


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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: [PATCH] Custom code int(32|64) => text conversions out of performance reasons
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: duplicate connection failure messages