Re: Improve list manipulation in several places

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, David Rowley <dgrowleyml(at)gmail(dot)com>, Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Subject: Re: Improve list manipulation in several places
Date: 2023-05-09 03:07:47
Message-ID: CAMbWs4-vs=SGXYYs89Kkqdcn78emKGdbzqF_p3v4WX5C9VnYGw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 8, 2023 at 11:22 PM Peter Eisentraut <
peter(dot)eisentraut(at)enterprisedb(dot)com> 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.

Thanks Peter for looking at those patches. I tried to devise a query to
show performance gain but did not succeed :-(. So I begin to wonder if
0002 is worthwhile to do, as it seems that it does not solve any real
problem.

Thanks
Richard

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2023-05-09 03:09:49 Re: [PoC] pg_upgrade: allow to upgrade publisher node
Previous Message Tom Lane 2023-05-09 03:06:47 Re: Cleaning up array_in()