]> git.ipfire.org Git - thirdparty/haproxy.git/commit
OPTIM: log: declare empty buffer as global variable
authorAurelien DARRAGON <adarragon@haproxy.com>
Tue, 30 Apr 2024 14:45:34 +0000 (16:45 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 4 May 2024 08:13:05 +0000 (10:13 +0200)
commit728b5aa835b40278f96a4330369bd6316fe51832
tree0b90b50e7d116086f8bd69c75cc0382b72c9e43d
parentcc2e94a9480557afb86ea8777bac49196d6f1715
OPTIM: log: declare empty buffer as global variable

'empty' buffer used in sess_build_logline() inside a loop, and since it
is only being read from and not modified, until recently it ended up being
cached most of the time and didn't cause overhead due to systematic push
on the stack.

However, due recent encoding work and new added variables on the stack,
we're starting to reach a stack limit and declaring 'empty' buffer within
the loop seems to cause non-negligible CPU overhead.

Since the variable isn't modified during log generation, let's declare
'empty' buffer as a global variable outside from sess_build_logline()
to prevent pushing it on the stack for each node evaluation.
src/log.c