Re: Performance improvements for src/port/snprintf.c

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Performance improvements for src/port/snprintf.c
Дата
Msg-id 30898.1538517873@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Performance improvements for src/port/snprintf.c  (Andres Freund <andres@anarazel.de>)
Ответы Re: Performance improvements for src/port/snprintf.c
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> I've looked through the patch. Looks good to me. Some minor notes:

[ didn't see this till after sending my previous ]

> - How about adding our own strchrnul for the case where we don't
>   HAVE_STRCHRNUL?  It's possible that other platforms have something
>   similar, and the code wouldlook more readable that way.

Sure, we could just make a "static inline strchrnul()" for use when
!HAVE_STRCHRNUL.  No objection.

> - I know it's not new, but is it actually correct to use va_arg(args, int64)
>   for ATYPE_LONGLONG?

Well, the problem with just doing s/int64/long long/g is that the
code would then fail on compilers without a "long long" type.
We could ifdef our way around that, but I don't think the code would
end up prettier.

Given that we only ever use "ll" modifiers via INT64_FORMAT, and that
that'll only be set to "ll" if int64 is indeed "long long", those code
paths should be dead code in any situation where the type pun is wrong.

            regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Performance improvements for src/port/snprintf.c
Следующее
От: Jacob Champion
Дата:
Сообщение: Re: Obtaining a more consistent view definition when a UNION subquerycontains undecorated constants