Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: mahendrakar s <mahendrakarforpg(at)gmail(dot)com>
Cc: Peter Smith <smithpb2250(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)
Date: 2022-08-02 14:18:12
Message-ID: CAEudQApx3LXxx0xANrTTaufGxS3AHOf=soOB+CBfW1v7JjR8hA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em ter., 2 de ago. de 2022 às 10:17, mahendrakar s <
mahendrakarforpg(at)gmail(dot)com> escreveu:

> Hi Ranier,
>
> I'm pretty late to thread but would like to know about your claim in the
> thread:
> `All compilers currently have memset optimized.`
>
What did I mean, modern compilers.

I know one case of optimization where variable is not used after the memset.
>
Probably, the compiler decided to remove the variable altogether.
The most common is to remove the padding, when he understands that this is
possible and safe.
This does not mean that this will happen in all cases.
The point here is, this is only possible when using memset.

> Are the cases for which the optimization is done consistent across all the
> compilers?
>
Of course not. But it does not matter.

regards,
Ranier Vilela

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2022-08-02 14:37:27 Re: Race between KeepFileRestoredFromArchive() and restartpoint
Previous Message David Steele 2022-08-02 14:14:22 Re: Race between KeepFileRestoredFromArchive() and restartpoint