Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>,
David Zhang <david.zhang@highgo.ca>,
Ranier Vilela <ranier.vf@gmail.com>,
Justin Pryzby <pryzby@telsasoft.com>,
David Rowley <dgrowleyml@gmail.com>,
Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2022-08-24T19:00:10Z
Lists: pgsql-hackers
Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes: > On 24.08.22 16:30, Alvaro Herrera wrote: >> If you do this, you're creating a potential backpatching hazard. This >> is OK if we get something in return, so a question to ask is whether >> there is any benefit in doing it. > I don't follow how this is a backpatching hazard. Call me a trogdolyte, but I don't follow how it's an improvement. It looks to me like an entirely random change that doesn't get rid of assumptions about what the bits are, it just replaces one set of assumptions with a different set. Moreover, the new set of assumptions may include "there are no padding bits in here", which is mighty fragile and hard to verify. So I frankly do not find this a stylistic improvement. regards, tom lane
Commits
-
Replace many MemSet calls with struct initialization
- 9fd45870c143 16.0 landed
-
Change some unnecessary MemSet calls
- 258f48f858b0 16.0 landed
-
Avoid unnecessary MemSet call
- 8cd61d288adf 16.0 landed