URL:
https://github.com/SSSD/sssd/pull/5525
Title: #5525: Log performance improvements.
alexey-tikhonov commented:
"""
At this point, you cache the whole string. If it differs, you
generate the whole string again. But most often the only thing that changes is only the
last "seconds" part. Do you think it would make a difference if we cache only
(or as a level 2 cache) the date and time without seconds that changes rarely?
I don't think so.
From my point of view, this would complicate code for a very minor perf gain, if any at
all (depends on implementation, but if we split timestamp str into two parts, it will
require additional '%s' and this will add an overhead for vfprintf() used under
the hood, and this will affect every debug line).
But most important, all those patches only matter for a case when SSSD logs a **lot**, say
hundreds lines per second. In this case timestamp re-creation once per second means <1%
of debug lines and thus very low perf impact.
"""
See the full comment at
https://github.com/SSSD/sssd/pull/5525#issuecomment-789658618