Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)
Date
Msg-id CAEudQApx3LXxx0xANrTTaufGxS3AHOf=soOB+CBfW1v7JjR8hA@mail.gmail.com
Whole thread Raw
In response to Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)  (mahendrakar s <mahendrakarforpg@gmail.com>)
List pgsql-hackers
Em ter., 2 de ago. de 2022 às 10:17, mahendrakar s <mahendrakarforpg@gmail.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

pgsql-hackers by date:

Previous
From: David Steele
Date:
Subject: Re: Race between KeepFileRestoredFromArchive() and restartpoint
Next
From: Noah Misch
Date:
Subject: Re: Race between KeepFileRestoredFromArchive() and restartpoint