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

From Tom Lane
Subject Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)
Date
Msg-id 64325.1652916013@sss.pgh.pa.us
Whole thread Raw
In response to Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
> I've been wondering for a while if we really need to have the MemSet()
> macro. I see it was added in 8cb415449 (1997).  I think compilers have
> evolved quite a bit in the past 25 years, so it could be time to
> revisit that.

Yeah, I've thought for awhile that technology has moved on from that.
Nobody's really taken the trouble to measure it though.  (And no,
results from one compiler on one machine are not terribly convincing.)

The thing that makes this a bit more difficult than it might be is
the special cases we have for known-aligned and so on targets, which
are particularly critical for palloc0 and makeNode etc.  So there's
more than one case to look into.  But I'd argue that those special
cases are actually what we want to worry about the most: zeroing
relatively small, known-aligned node structs is THE use case.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: ALTER TABLE SET ACCESS METHOD on partitioned tables
Next
From: Ranier Vilela
Date:
Subject: Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)