From: Eric Sunshine Date: Wed, 07 Jul 2021 20:10:29 GMT Subject: Re: [PATCH 2/3] strbuf.h API users: don't hardcode 8192, use STRBUF_HINT_SIZE Message-ID: In-Reply-To: On Wed, Jul 7, 2021 at 6:38 AM Ævar Arnfjörð Bjarmason wrote: > Change a couple of users of strbuf_init() that pass a hint of 8192 to > pass STRBUF_HINT_SIZE instead. > > Both of these hardcoded occurrences pre-date the use of the strbuf > API. See 5242bcbb638 (Use strbuf API in cache-tree.c, 2007-09-06) and > af6eb82262e (Use strbuf API in apply, blame, commit-tree and diff, > 2007-09-06). > > In both cases the exact choice of 8192 is rather arbitrary, e.g. for > commit buffers I think 1024 or 2048 would probably be a better > default (this commit message is getting this commit close to the > former, but I daresay it's already way above the average for git > commits). > > In any case, if we ever tweak STRBUF_HINT_SIZE we'll probably do so on > the basis of some codease-wide performance tests, so replacing the Did you mean? s/codease/code/ > hardcoded value with STRBUF_HINT_SIZE should be safe, they're the same > now, and if we change STRBUF_HINT_SIZE in the future this is one of > the main codepaths we'll be testing. > > Signed-off-by: Ævar Arnfjörð Bjarmason