Re: RFC: Improve CPU cache locality of syscache searches

Поиск
Список
Период
Сортировка
От John Naylor
Тема Re: RFC: Improve CPU cache locality of syscache searches
Дата
Msg-id CAFBsxsEj=9Og1-w81u2zRhh-eJTPLE-N83eDvbcSUF-SqocFgQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: RFC: Improve CPU cache locality of syscache searches  (Andres Freund <andres@anarazel.de>)
Ответы Re: RFC: Improve CPU cache locality of syscache searches  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers

On Thu, Aug 5, 2021 at 4:12 PM Andres Freund <andres@anarazel.de> wrote:
> I have wondered before whether we should have syscache definitions generate
> code specific to each syscache definition. I do think that'd give a good bit
> of performance boost. But I don't see a trivial way to get there without
> notational overhead.

I've made a small step in this direction in the attached. It uses a template approach to generate type-specific SearchCatCache* functions, for now only the 4-key ones. Since there's only a few of those, it's manageable to invoke the template and change the call sites by hand. To get this to scale up to all syscaches would require some scripting, but this much is enough to get feedback on the approach. One possible concern in starting down this path is that hundreds of call sites would have to be changed. (If there's a good way around that, it hasn't occurred to me.) It might also be possible to replace the per-key invocations with a single memcpy() for most types, but that's a bit more work.

--
John Naylor
EDB: http://www.enterprisedb.com
Вложения

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: [PATCH] Proof of concept for GUC improvements
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: elog.c query_id support vs shutdown