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

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [PATCH] Custom code int(32|64) => text conversions out of performance reasons
Дата
Msg-id AANLkTik4QXhrgkv_K+5+hDakRcasWF3eGOmmagxm8FTw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Custom code int(32|64) => text conversions out of performance reasons  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: [PATCH] Custom code int(32|64) => text conversions out of performance reasons  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Fri, Nov 19, 2010 at 10:18 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> Sure thing.  Thanks for taking time to do this - very nice speedup.
> This part now committed, too.

It occurs to me belatedly that there might be a better way to do this.Instead of flipping value from negative to
positive,with a special 
case for the smallest possible integer, we could do it the other
round.  And actually, I think we can rid of neg, too.

if (value < 0)   *a++ = '-';
else   value = -value;
start = a;

Then we could just adjust the calculation of the actual digit.

*a++ = '0' + (-remainder);

Good idea?  Bad idea?  Seems cleaner to me, assuming it'll actually work...

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Fwd: patch: format function - fixed oid
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Fwd: patch: format function - fixed oid