git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 6dbb490) | patch
Inline pg_popcount() for small buffers.
Wed, 3 Apr 2024 17:22:02 +0000 (12:22 -0500)
Wed, 3 Apr 2024 17:22:02 +0000 (12:22 -0500)
commit deb1486c7d36e5430b50b63e8c0f2d8405e24a2a
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
src/include/port/pg_bitutils.h diff | blob | blame | history
src/port/pg_bitutils.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /