Re: make additional use of optimized linear search routines

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: make additional use of optimized linear search routines
Дата
Msg-id YyqjvS3HumArAxwq@paquier.xyz
обсуждение исходный текст
Ответ на Re: make additional use of optimized linear search routines  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: make additional use of optimized linear search routines  (Richard Guo <guofenglinux@gmail.com>)
Список pgsql-hackers
On Sat, Sep 03, 2022 at 10:06:58AM +0900, Michael Paquier wrote:
> Ohoh.  This sounds like a good idea to me, close to what John has
> applied lately.  I'll take a closer look..

So, the two code paths patched here are rather isolated.  The one in
TransactionIdIsInProgress() requires an overflowed set of subxids
still running, something similar to what the isolation test
subxid-overflow does.  XidIsConcurrent() is also kind of hard to
reason about with a benchmark.

Anyway, I did not know about the work done with SIMD instructions in
pg_lfind.h and after playing the API I have run some micro benchmarks
with on pg_lfind32() and I can see some improvements.  With a range of
100~10k elements in a fixed number of repeated calls with a for loop
and lfind(), I could not get up to the 40% speedup.  That was somewhat
closer to 15%~20% on x86 and 20%~25% with arm64.  There is a trend
where things got better with a higher number of elements with
lfind().

In short, switching those code paths to use the linear search routines
looks like a good thing in the long-term, so I would like to apply
this patch.  If you have any comments or objections, please feel
free.
--
Michael

Вложения

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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: [PATCH]Feature improvement for MERGE tab completion
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: Fix snapshot name for SET TRANSACTION documentation