Hi, On Wed, Nov 06, 2024 at 01:44:58PM +0900, Michael Paquier wrote: > Should the last loop check only 1 byte at a time or should this stuff > include one more step before the last one you wrote to do a couple of > checks with size_t? That may matter for areas small enough (len < > sizeof(size_t) * 8) causing the second step to not be taken, but large > enough (len > sizeof(size_t)) to apply a couple of size_t checks per > loop.
Do you mean add: " for (; p < aligned_end; p += sizeof(size_t)) { if (*(size_t *)p != 0) return false; } " just before the last loop? If so, I did a few tests and did not see any major improvements. So, I thought it's simpler to not add more code in this inline function in v7 shared up-thread. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com