Eliminate select(2) system calls when they are not necessary.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Fri, 22 Feb 2019 01:09:09 +0000 (10:09 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Fri, 22 Feb 2019 01:09:09 +0000 (10:09 +0900)
commitcf5fe7eb89a11e3ada3833343c7ed6551ce7c662
tree6e19bb33c974c758cd2be31105504779eb4334a2
parentc766d1b7a75bd5e7dbf113d1a836cae8214fec47
Eliminate select(2) system calls when they are not necessary.

The idea is checking select(2) timeout parameter set in a static
variable in pool_read() and pool_read2(). If it's -1, it means no
select timeout will be set in pool_check_fd(), which implies we can
avoid to call pool_check_fd().

Also I moved pool_check_fd() and friends to pool_stream.c from a
modularity point of view.

This gives slight performance improvement according to Jesper
Pedersen.

Bottleneck analysis and suggestions from Jesper Pedersen.
Discussion: [pgpool-hackers: 3247] https://www.pgpool.net/pipermail/pgpool-hackers/2019-February/003247.html
src/include/pool.h
src/include/utils/pool_stream.h
src/protocol/pool_process_query.c
src/utils/pool_stream.c