Re: [PATCH v4 12/13] pack-bitmap.c: use `ewah_or_iterator` for type bitmap iterators
- From
Jeff King <peff@peff.net>
- Date
- Mar 18, 2025, 02:05 UTC
- Message-ID
- <20250318020526.GB1473033@coredump.intra.peff.net>
- In-Reply-To
- <a1cf65bedc94ab6e318ff81a6d48eb30b6fc7868.1741983492.git.me@ttaylorr.com>
On Fri, Mar 14, 2025 at 04:18:56PM -0400, Taylor Blau wrote:
Show 10 quoted lines
> -static void init_type_iterator(struct ewah_iterator *it,
> +static void init_type_iterator(struct ewah_or_iterator *it,
> struct bitmap_index *bitmap_git,
> enum object_type type)
> {
> switch (type) {
> case OBJ_COMMIT:
> - ewah_iterator_init(it, bitmap_git->commits);
> + ewah_or_iterator_init(it, bitmap_git->commits_all,
> + bitmap_git->base_nr + 1);This certainly makes sense. It looks like we now use the or_iterator unconditionally, even for non-layered queries. It's probably a little slower in practice, just because it's an extra layer of indirection. But I don't know if trying to micro-optimize here is worth it. In general I'd say no, but sometimes there are surprising tight loops with bitmaps.
I dunno. I guess it would be easy enough to do a simple before/after benchmark on a single packfile with this series. I wouldn't expect it to find anything, but might not hurt to double check.
-Peff