Re: define pg_structiszero(addr, s, r)
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>,
Peter Smith <smithpb2250@gmail.com>, Peter Eisentraut <peter@eisentraut.org>,
Heikki Linnakangas <hlinnaka@iki.fi>, pgsql-hackers@lists.postgresql.org
Date: 2024-11-01T07:21:50Z
Lists: pgsql-hackers
On Fri, 1 Nov 2024 at 19:33, Bertrand Drouvot <bertranddrouvot.pg@gmail.com> wrote: > Agree, I did a quick test (see [0]) and it looks like it's significantly slower > using the new inline function. > > We could try to write a more elaborate version of pg_memory_is_all_zeros(), but > as it looks like there is only one use case, then it's probably better to not > implement (revert) this change here and "just" add a comment as to why pg_memory_is_all_zeros() > should not be used here, thoughts? My vote is to just revert this usage of the function. Anything more elaborate would need to check pointer alignment before using any types larger than char. The previous code does not need to do that because the page is going to be at least MAXALIGNed. David
Commits
-
Use pg_memory_is_all_zeros() in PageIsVerifiedExtended()
- 03a42c9652f8 18.0 landed
-
Optimize pg_memory_is_all_zeros() in memutils.h
- 5be1dabd2ae0 18.0 landed
-
Remove use of pg_memory_is_all_zeros() in bufpage.c
- e819bbb7c82a 18.0 landed
-
Add pg_memory_is_all_zeros() in memutils.h
- 07e9e28b56db 18.0 landed