On Wed, Jul 7, 2021 at 6:38 AM Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> 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 <avarab@xxxxxxxxx>