HomeClusterLabs Projects

Refactor: libcrmcommon: g_string_append_printf -> pcmk__g_strcat()

Description

Refactor: libcrmcommon: g_string_append_printf -> pcmk__g_strcat()

g_string_*printf() is not strictly necessary when all the interpolated
objects are strings. A sequence of g_string_append() calls suffices and
performs much better (with -O2 compiler optimization enabled).
pcmk__g_strcat() is a convenience wrapper for such a sequence of
g_string_append() calls.

This change yields a significant performance boost on crm_simulate
tests.

Ref T152

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Sep 22 2022, 12:27 AM
Parents
rPea74fd1f48a0: Refactor: libcrmcommon: NULL checks in pcmk__format_option_metadata()
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task