Re: [PATCH] Small optimization across postgres (remove strlenduplicate usage)

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: [PATCH] Small optimization across postgres (remove strlenduplicate usage)
Дата
Msg-id 20200419193326.lf74hil2ks2vtsof@development
обсуждение исходный текст
Ответ на [PATCH] Small optimization across postgres (remove strlen duplicate usage)  (Ranier Vilela <ranier.vf@gmail.com>)
Ответы Re: [PATCH] Small optimization across postgres (remove strlenduplicate usage)
Re: [PATCH] Small optimization across postgres (remove strlen duplicate usage)
Список pgsql-hackers
On Sun, Apr 19, 2020 at 11:24:38AM -0300, Ranier Vilela wrote:
>Hi,
>strlen it is one of the low fruits that can be harvested.
>What is your opinion?
>

That assumes this actually affects/improves performance, without any
measurements proving that. Considering large number of the places you
modified are related to DDL (CreateComment, ChooseIndexColumnNames, ...)
or stuff that runs only once or infrequently (like the changes in
PostmasterMain or libpqrcv_get_senderinfo). Likewise, it seems entirely
pointless to worry about strlen() overhead e.g. in fsync_parent_path
which is probably dominated by I/O.

Maybe there are places where this would help, but I don't see a reason
to just throw away all strlen calls and replace them with something
clearly less convenient and possibly more error-prone (I'd expect quite
a few off-by-one mistakes with this).


regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Justin Pryzby
Дата:
Сообщение: Re: DETACH PARTITION and FOR EACH ROW triggers on partitioned tables
Следующее
От: Alexander Lakhin
Дата:
Сообщение: Re: HEAPDEBUGALL is broken