Re: optimize lookups in snapshot [sub]xip arrays
От | Andres Freund |
---|---|
Тема | Re: optimize lookups in snapshot [sub]xip arrays |
Дата | |
Msg-id | 20220805220434.6h2aa7eww5rxird6@awork3.anarazel.de обсуждение исходный текст |
Ответ на | Re: optimize lookups in snapshot [sub]xip arrays (Nathan Bossart <nathandbossart@gmail.com>) |
Ответы |
Re: optimize lookups in snapshot [sub]xip arrays
|
Список | pgsql-hackers |
Hi, On 2022-08-05 13:25:10 -0700, Nathan Bossart wrote: > I went ahead and renamed it to pg_lfind32() and switched it back to > returning the pointer. That felt the cleanest from the naming perspective, > but as Andres noted, it might not be as fast as just looking for the > presence of the element. I modified my small testing program to perform > many searches on small arrays, and I wasn't able to identify any impact, so > perhaps thіs is good enough. Why on small arrays? I'd expect a difference mainly if it there's at least a few iterations. But mainly I'd expect to find a difference if the SIMD code were optimized a further on the basis of not needing to return the offset. E.g. by replacing _mm_packs_epi32 with _mm_or_si128, that's cheaper. - Andres
В списке pgsql-hackers по дате отправления: