Re: define pg_structiszero(addr, s, r) - Mailing list pgsql-hackers

From David Rowley
Subject Re: define pg_structiszero(addr, s, r)
Date
Msg-id CAApHDvp==ynKyrV0OjuBH_rJ208hcK4kUJUc8v_0=EyFYAU2Zw@mail.gmail.com
Whole thread Raw
In response to Re: define pg_structiszero(addr, s, r)  (Peter Eisentraut <peter@eisentraut.org>)
List pgsql-hackers
On Thu, 7 Nov 2024 at 07:34, Peter Eisentraut <peter@eisentraut.org> wrote:
> Speaking of which, couldn't you just use
>
>      pg_popcount(ptr, len) == 0

That might be quite good for small lengths or for use cases where the
memory is always or almost always zero. The problem is there's no
early exit when you find the first non-zero which means, for larger
lengths, reading much more memory. That'll both take longer and
possibly evict cache lines which might be useful to have in the near
future.

David



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Windows meson build
Next
From: Robert Haas
Date:
Subject: magical eref alias names