[pgpool-committers: 8650] pgpool: Skipping useless ereport/elog calls.

Muhammad Usama m.usama at gmail.com
Tue May 31 20:33:10 JST 2022


Skipping useless ereport/elog calls.

Although ereport() and elog() themselves are quite cheap when the error message
level is too low to be printed, some places need to do substantial work before
they can call those macros at all. message_level_is_interesting() can be handy
to allow optimizing away such setup work when nothing is to be printed.

Function message_level_is_interesting(elevel) is borrowed from PostgreSQL
source that reports whether ereport/elog will do anything.

Branch
------
master

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=5a0d28309da96b65d142e10d5f22485518e89a08

Modified Files
--------------
src/context/pool_session_context.c |   3 +
src/include/utils/elog.h           |   1 +
src/utils/error/elog.c             | 127 ++++++++++++++++++++++++-------------
src/utils/pool_stream.c            |   3 +
src/utils/socket_stream.c          |   3 +
src/watchdog/watchdog.c            |  15 +++--
6 files changed, 101 insertions(+), 51 deletions(-)



More information about the pgpool-committers mailing list