On Wed, Jan 25, 2017 at 11:21:11AM -0800, Junio C Hamano wrote:
> > diff --git a/object.h b/object.h
> > index 614a00675..f52957dcb 100644
> > --- a/object.h
> > +++ b/object.h
> > @@ -29,7 +29,7 @@ struct object_array {
> > /*
> > * object flag allocation:
> > * revision.h:
Jeff King writes:
> +struct alternate_object_cache {
> + struct object **items;
> + size_t nr, alloc;
> +};
> +
> +static void cache_one_alternate(const char *refname,
> + const struct object_id *oid,
> + void
We may run for_each_alternate_ref() twice, once in
find_common() and once in everything_local(). This operation
can be expensive, because it involves running a sub-process
which must freshly load all of the alternate's refs from
disk.
Let's cache and reuse the results between the two calls. We
3 matches
Mail list logo