]> git.ipfire.org Git - thirdparty/haproxy.git/commit
OPTIM: log: speedup date printing in sess_build_logline() when no encoding is used
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 2 May 2024 15:04:28 +0000 (17:04 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 4 May 2024 08:13:05 +0000 (10:13 +0200)
commitd26a1601336a7f345af96548bc18edd202ef2557
treeb75ec68cf09036e9e6cbb6a2016037267e800a0d
parentbf3b4001ce16de109d8c786dee118e62a189bab2
OPTIM: log: speedup date printing in sess_build_logline() when no encoding is used

In sess_build_logline(), we have multiple fieds such as '%t' that build
a fixed-length string out of a date struct and then print it using
lf_rawtext(). In fact, printing it using lf_rawtext() is only mandatory
to deal with encoding options, but when no encoding is used we can output
the result to tmplog directly. Since most dates generate between 25 and 30
chars, doing so spares us from writing them twice and could help make
sess_build_logline() a bit faster when no encoding is used. (to match with
pre-encoding patch series performance).
src/log.c