Re: [PATCH v1] elog.c: Remove special case which avoided %*s format strings..

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [PATCH v1] elog.c: Remove special case which avoided %*s format strings..
Дата
Msg-id 20200804073555.GE2091@paquier.xyz
обсуждение исходный текст
Ответ на [PATCH v1] elog.c: Remove special case which avoided %*s format strings..  (Justin Pryzby <pryzby@telsasoft.com>)
Ответы Re: [PATCH v1] elog.c: Remove special case which avoided %*s format strings..  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-hackers
On Sun, Aug 02, 2020 at 11:59:48PM -0500, Justin Pryzby wrote:
> ..which should no longer be needed since it was a performance hack for specific
> platform snprintf, which are no longer used.

Did you check if our implementation of src/port/snprintf.c makes %*s
much slower than %s or not?  FWIW, I have just run a small test on my
laptop, and running 100M calls of snprintf() with "%s" in a tight loop
takes 2.7s, with "%*s" and a padding of 0 it takes 4.2s.  So this test
tells that we are far from something that's substantially slower, and
to simplify the code your change makes sense.  Still, there could be a
point in keeping this optimization, but fix the comment to remove the
platform-dependent part of it.  Any thoughts?
--
Michael

Вложения

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

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions
Следующее
От: Dave Page
Дата:
Сообщение: Re: EDB builds Postgres 13 with an obsolete ICU version