pgsql: Inline pg_popcount() for small buffers.

Поиск
Список
Период
Сортировка
От Nathan Bossart
Тема pgsql: Inline pg_popcount() for small buffers.
Дата
Msg-id E1rs4LU-000Kcm-DM@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Inline pg_popcount() for small buffers.

If there aren't many bytes to process, the function call overhead
of the optimized implementation isn't worth taking, so instead we
inline a loop that consults pg_number_of_ones in that case.  If
there are many bytes to process, we accept the function call
overhead because the optimized versions are likely to be faster.
The threshold at which we use the optimized implementation is set
to the smallest amount of data required to use special popcount
instructions.

Reviewed-by: Alvaro Herrera, Tom Lane
Discussion: https://postgr.es/m/20240402155301.GA2750455%40nathanxps13

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/deb1486c7d36e5430b50b63e8c0f2d8405e24a2a

Modified Files
--------------
src/include/port/pg_bitutils.h | 38 ++++++++++++++++++++++++++++++++++++--
src/port/pg_bitutils.c         | 12 ++++++------
2 files changed, 42 insertions(+), 8 deletions(-)


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: [MASSMAIL]pgsql: Refactor how heap_prune_chain() updates prunable_xid
Следующее
От: Alvaro Herrera
Дата:
Сообщение: [MASSMAIL]pgsql: Split XLogCtl->LogwrtResult into separate struct members