Re: Improve list manipulation in several places

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Improve list manipulation in several places
Дата
Msg-id 20230508172558.7ofri5pn3axndew3@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: Improve list manipulation in several places  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Ответы Re: Improve list manipulation in several places  (Ranier Vilela <ranier.vf@gmail.com>)
Re: Improve list manipulation in several places  (Richard Guo <guofenglinux@gmail.com>)
Список pgsql-hackers
On 2023-May-08, Peter Eisentraut wrote:

> On 23.04.23 08:42, Richard Guo wrote:
> > Thanks for the suggestion.  I've split the patch into two as attached.
> > 0001 is just a minor simplification by replacing lfirst(list_head(list))
> > with linitial(list).  0002 introduces new functions to reduce the
> > movement of list elements in several places so as to gain performance
> > improvement and benefit future callers.
> 
> These look sensible to me.  If you could show some numbers that support the
> claim that there is a performance advantage, it would be even more
> convincing.

0001 looks fine.

The problem I see is that each of these new functions has a single
caller, and the only one that looks like it could have a performance
advantage is list_copy_move_nth_to_head() (which is the weirdest of the
lot).  I'm inclined not to have any of these single-use functions unless
a performance case can be made for them.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/



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

Предыдущее
От: Dagfinn Ilmari Mannsåker
Дата:
Сообщение: Re: Tab completion for CREATE SCHEMAAUTHORIZATION
Следующее
От: Ranier Vilela
Дата:
Сообщение: Re: Improve list manipulation in several places