Re: src/port/snprintf.c: Optimize the common base=10 case in fmtint

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: src/port/snprintf.c: Optimize the common base=10 case in fmtint
Дата
Msg-id 108921.1635273188@sss.pgh.pa.us
обсуждение исходный текст
Ответ на src/port/snprintf.c: Optimize the common base=10 case in fmtint  (Arjan van de Ven <arjan@linux.intel.com>)
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2021-10-26 13:51:55 -0400, Tom Lane wrote:
>> I'd be inclined to just hard-wire the three allowed cases, and not have
>> an arbitrary-divisor code path at all.

> Yea, I came to the same conclusion. But I'd implement it by moving the
> division into a separate inline function called from the switch. I tested that
> locally and it works, but I got sidetracked by [1].

Uh, why not just a "switch (base)" around three copies of the loop?
Don't overthink this.

            regards, tom lane



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: changes in pgport etc doesn't cause client programs to be relinked
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: CREATEROLE and role ownership hierarchies