projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6687430
)
Avoid function call overhead of pg_popcount() in syslogger.c.
author
Nathan Bossart
<
[email protected]
>
Tue, 2 Apr 2024 15:32:49 +0000
(10:32 -0500)
committer
Nathan Bossart
<
[email protected]
>
Tue, 2 Apr 2024 15:32:49 +0000
(10:32 -0500)
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
src/backend/postmaster/syslogger.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/postmaster/syslogger.c
b/src/backend/postmaster/syslogger.c
index 08efe74cc910c63811464df99637788db18276c7..437947dbb9d66d8c29b5e46c4b50596551980123 100644
(file)
--- 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;