From: Jeff King Date: Mon, 04 Nov 2019 19:55:08 GMT Subject: Re: [PATCH] trace2: add dots directly to strbuf in perf_fmt_prepare() Message-ID: <20191104195508.GB20900@sigill.intra.peff.net> In-Reply-To: On Mon, Nov 04, 2019 at 08:27:54PM +0100, René Scharfe wrote: > The initialization function of the Trace2 performance format target sets > aside a stash of dots for indenting output. Get rid of it and use > strbuf_addchars() to provide dots on demand instead. This shortens the > code, gets rid of a small heap allocation and is a bit more efficient. Yeah, the end result is much easier on the eyes. I am scratching my head at whether there is any advantage to copying the separate buffer, but I don't see one. The likelihood of having to allocate in the final "buf" strbuf is the same either way. -Peff