mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
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
This commit is contained in:
@@ -898,7 +898,7 @@ process_pipe_input(char *logbuffer, int *bytes_in_logbuffer)
|
|||||||
if (p.nuls[0] == '\0' && p.nuls[1] == '\0' &&
|
if (p.nuls[0] == '\0' && p.nuls[1] == '\0' &&
|
||||||
p.len > 0 && p.len <= PIPE_MAX_PAYLOAD &&
|
p.len > 0 && p.len <= PIPE_MAX_PAYLOAD &&
|
||||||
p.pid != 0 &&
|
p.pid != 0 &&
|
||||||
pg_popcount((char *) &dest_flags, 1) == 1)
|
pg_number_of_ones[dest_flags] == 1)
|
||||||
{
|
{
|
||||||
List *buffer_list;
|
List *buffer_list;
|
||||||
ListCell *cell;
|
ListCell *cell;
|
||||||
|
Reference in New Issue
Block a user