Re: [PATCH v2 0/2] builtin/repo: improve counting of objects
- From
Kristofer Karlsson <krka@spotify.com>
- Date
- Nov 16, 2026, 09:07 UTC
- Message-ID
- <CAL71e4OcVOS4LPeNmLmF-92PMB_NC5NNZieAdGB15g4Yr7n01g@mail.gmail.com>
- In-Reply-To
- <20261116-pks-repo-count-objects-speedup-v2-0-9c8be218eaff@pks.im>
On Mon, 16 Nov 2026 at 09:01, Patrick Steinhardt <ps@pks.im> wrote:
Show 17 quoted lines
> > 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