Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

+1-1
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)