Skip to content

Commit 4133c1f

Browse files
Avoid function call overhead of pg_popcount() in syslogger.c.
Instead of calling the pg_popcount() function for a single byte, we can look up the value in the pg_number_of_ones array. Discussion: https://postgr.es/m/20240401221117.GB2362108%40nathanxps13
1 parent 6687430 commit 4133c1f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/postmaster/syslogger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ process_pipe_input(char *logbuffer, int *bytes_in_logbuffer)
898898
if (p.nuls[0] == '\0' && p.nuls[1] == '\0' &&
899899
p.len > 0 && p.len <= PIPE_MAX_PAYLOAD &&
900900
p.pid != 0 &&
901-
pg_popcount((char *) &dest_flags, 1) == 1)
901+
pg_number_of_ones[dest_flags] == 1)
902902
{
903903
List *buffer_list;
904904
ListCell *cell;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy