Re: define pg_structiszero(addr, s, r)

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: define pg_structiszero(addr, s, r)
Дата
Msg-id 2ed3e31e-55ee-41f6-8841-b096a798f504@iki.fi
обсуждение исходный текст
Ответ на Re: define pg_structiszero(addr, s, r)  (Peter Eisentraut <peter@eisentraut.org>)
Ответы Re: define pg_structiszero(addr, s, r)
Список pgsql-hackers
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)




В списке pgsql-hackers по дате отправления: