Re: Optimizing Node Files Support

From: John Naylor <john(dot)naylor(at)enterprisedb(dot)com>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Optimizing Node Files Support
Date: 2022-12-02 12:24:39
Message-ID: CAFBsxsE+cuaUGTJfDGLK8tx+a5DKyk-9+PA7qnb2OgUBYORZtQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 1, 2022 at 8:02 PM Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> wrote:
>
> Hi,
>
> I believe that has room for improving generation node files.
>
> The patch attached reduced the size of generated files by 27 kbytes.
> From 891 kbytes to 864 kbytes.
>
> About the patch:
> 1. Avoid useless attribution when from->field is NULL, once that
> the new node is palloc0.
>
> 2. Avoid useless declaration variable Size, when it is unnecessary.

Not useless -- it prevents a multiple evaluation hazard, which this patch
introduces.

> 3. Optimize comparison functions like memcmp and strcmp, using
> a short-cut comparison of the first element.

Not sure if the juice is worth the squeeze. Profiling would tell.

> 4. Switch several copy attributions like COPY_SCALAR_FIELD or
COPY_LOCATION_FIELD
> by one memcpy call.

My first thought is, it would cause code churn.

> 5. Avoid useless attribution, ignoring the result of pg_strtok when it is
unnecessary.

Looks worse.

--
John Naylor
EDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2022-12-02 12:27:14 Re: Report roles in pg_upgrade pg_ prefix check
Previous Message Daniel Gustafsson 2022-12-02 12:04:11 Re: pg_upgrade: Make testing different transfer modes easier