summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Bossart2024-04-02 15:32:49 +0000
committerNathan Bossart2024-04-02 15:32:49 +0000
commit4133c1f45c54f0e52b4bb758f67af78951930e43 (patch)
tree72baeaf19d88c6423727d57899acfd3f9ae5ee8b
parent6687430c98f3bed1d4c5f85f05a230b0d4581a66 (diff)
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
-rw-r--r--src/backend/postmaster/syslogger.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/postmaster/syslogger.c b/src/backend/postmaster/syslogger.c
index 08efe74cc91..437947dbb9d 100644
--- a/src/backend/postmaster/syslogger.c
+++ b/src/backend/postmaster/syslogger.c
@@ -898,7 +898,7 @@ process_pipe_input(char *logbuffer, int *bytes_in_logbuffer)
if (p.nuls[0] == '\0' && p.nuls[1] == '\0' &&
p.len > 0 && p.len <= PIPE_MAX_PAYLOAD &&
p.pid != 0 &&
- pg_popcount((char *) &dest_flags, 1) == 1)
+ pg_number_of_ones[dest_flags] == 1)
{
List *buffer_list;
ListCell *cell;