From: Martin Pieuchot Subject: Re: faster history traversal for 'got blame' To: gameoftrees@openbsd.org Date: Wed, 8 Jan 2020 08:33:06 +0100 On 07/01/20(Tue) 18:57, Stefan Sperling wrote: > On Tue, Jan 07, 2020 at 01:02:13PM +0100, Martin Pieuchot wrote: > > got_packidx_init_hdr() is also taking a lot of CPU time. Is it because > > of the SHA operations? Is git using the sames? Can they be improved? > > The answer is that the pack index caching code is broken. > This function was called way too often: 749 times for 14 pack files. > The diff below fixes this bug and reduces this function to 2.2%. > Updated profile graph attached. > However, this patch only has a very small impact on performance. Maybe. On the other hand the profiled picture becomes clearer: now ~36% of CPU time is spent diffing... One question below: > @@ -129,6 +129,7 @@ > #define GOT_ERR_REF_NAME_MINUS 113 > #define GOT_ERR_GITCONFIG_SYNTAX 114 > #define GOT_ERR_REBASE_OUT_OF_DATE 115 > +#define GOT_ERR_CACHE_DUP_ENTRY 116 > > static const struct got_error { > int code; > @@ -265,6 +266,7 @@ static const struct got_error { > { GOT_ERR_GITCONFIG_SYNTAX, "gitconfig syntax error" }, > { GOT_ERR_REBASE_OUT_OF_DATE, "work tree must be updated before it " > "can be used to rebase a branch" }, > + { GOT_ERR_CACHE_DUP_ENTRY, "duplicate cache entry" }, Isn't a duplicated cache entry some kind of code error? Or this can happen in a repo?