]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: clock: don't compute before_poll when using monotonic clock
authorWilly Tarreau <w@1wt.eu>
Sun, 8 Sep 2024 19:03:30 +0000 (19:03 +0000)
committerWilly Tarreau <w@1wt.eu>
Tue, 17 Sep 2024 07:08:10 +0000 (09:08 +0200)
commit499e057644d659ac61bd13cc50e75aadf33cdbdd
tree9b4efd9689729e9c146e27eabcee373fa1f386fa
parent24496803d16e0397893602b8df8d2c57b3c72087
MEDIUM: clock: don't compute before_poll when using monotonic clock

There's no point keeping both clocks up to date; if the monotonic clock
is ticking, let's just refrain from updating the wall clock one before
polling since we won't use it. We still do it after polling however as
we need a wall clock time to communicate with outside.

This saves one gettimeofday() call per loop and two timeval comparisons.
src/clock.c