From: Kristofer Karlsson Date: Mon, 16 Nov 2026 09:07:27 GMT Subject: Re: [PATCH v2 0/2] builtin/repo: improve counting of objects Message-ID: In-Reply-To: <20261116-pks-repo-count-objects-speedup-v2-0-9c8be218eaff@pks.im> On Mon, 16 Nov 2026 at 09:01, Patrick Steinhardt wrote: > > Range-diff versus v1: > > 1: a7a1c1a8041 ! 1: 2780e491ead builtin/repo: only parse objects as needed > @@ builtin/repo.c: static int count_objects(const char *path UNUSED, struct oid_arr > case OBJ_COMMIT: > - commit = object_as_type(obj, OBJ_COMMIT, 0); > + /* > -+ * Commits have already been parsed by the revision > -+ * walk, so there is no need to read their contents > -+ * again. > ++ * Commits should already have been parsed by the > ++ * revision walk, so in theory we do not need to read > ++ * their contents again. > + */ > + commit = lookup_commit(data->odb->repo, &oids->oid[i]); > + if (!commit || repo_parse_commit(data->odb->repo, commit)) I think this range-diff addresses my only nit, so I am happy with this version! Thanks, Kristofer