public inbox for [email protected]
help / color / mirror / Atom feedRe: define pg_structiszero(addr, s, r)
1+ messages / 1 participants
[nested] [flat]
* Re: define pg_structiszero(addr, s, r)
@ 2024-10-29 09:39 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 1+ messages in thread
From: Heikki Linnakangas @ 2024-10-29 09:39 UTC (permalink / raw)
To: Bertrand Drouvot <[email protected]>; Peter Smith <[email protected]>; +Cc: Peter Eisentraut <[email protected]>; [email protected]
On 29/10/2024 09:54, Bertrand Drouvot wrote:
>> https://godbolt.org/z/x9hPWjheq.
>
> Yeah, I also think that's fine. Peter Smith did some testing in [1] comparing
> memcmp and simple loop checking (thanks Peter for the testing!):
>
> "
> Iterate 1000000 times...
> check zeros using loop -- elapsed=0.041196s
> check zeros using memcmp -- elapsed=0.016407s
> "
>
> So, in this test, the loop is 0.024789s longer means 0.024789s/1000000=24 Nanosecond
> slower per comparison (If my math is correct).
I believe that test program is bogus. Look at the assembly code; the
compiler optimized away the loops.
--
Heikki Linnakangas
Neon (https://neon.tech)
^ permalink raw reply [nested|flat] 1+ messages in thread
only message in thread
Thread overview: 1+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-10-29 09:39 Re: define pg_structiszero(addr, s, r) Heikki Linnakangas <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox