From: René Scharfe Date: Sat, 11 Sep 2021 20:31:34 GMT Subject: Re: [PATCH 4/3] midx: inline nth_midxed_pack_entry() Message-ID: <120ffa79-d3cb-2e81-1da6-358e7407ec69@web.de> In-Reply-To: Am 11.09.21 um 19:07 schrieb Jeff King: > On Sat, Sep 11, 2021 at 06:08:42PM +0200, René Scharfe wrote: > >> @@ -304,8 +307,7 @@ static int nth_midxed_pack_entry(struct repository *r, >> if (!is_pack_valid(p)) >> return 0; >> >> - nth_midxed_object_oid(&oid, m, pos); >> - if (oidset_contains(&p->bad_objects, &oid)) >> + if (oidset_contains(&p->bad_objects, oid)) >> return 0; > > So we get to avoid the nth_midxed_object_oid() copy entirely. Very nice. > > Compared to the code before your series, we still have an extra function > call to oidset_contains(), which will (in the common case) notice we > have no entries and immediately return. But I think that's getting into > pointless micro-optimization. Right. I measure a 0.5% slowdown for git multi-pack-index verify. An inline oidset_size call avoids it. That's easy enough to add, so let's have it! René