public inbox for [email protected]
help / color / mirror / Atom feedFrom: Heikki Linnakangas <[email protected]>
To: Bertrand Drouvot <[email protected]>
To: Peter Smith <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Cc: [email protected]
Subject: Re: define pg_structiszero(addr, s, r)
Date: Tue, 29 Oct 2024 11:39:03 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <ZyCUsIu/[email protected]>
References: <[email protected]>
<[email protected]>
<ZusioyiXTyKpOP/[email protected]>
<[email protected]>
<ZyCUsIu/[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)
view thread (2+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: define pg_structiszero(addr, s, r)
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox