Re: [PATCH] check_refname_component: Optimize

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 30, 2014 at 06:24:30AM +0700, Duy Nguyen wrote:

> >> I wonder if we can get away without SSE code by saving stat info of
> >> the packed-refs version that we have verified. When we read pack-refs,
> >> if stat info matches, skip check_refname_component(). Assuming that
> >> pack-refs does not change often, of course.
> >
> > Can you elaborate a bit more?
> 
> The first time we read packed_refs, check_refname_format() is called
> in read_packed_refs()->create_ref_entry() as usual. If we find no
> problem, we store packed_refs stat() info in maybe packed_refs.stat.
> Next time we read packed_refs, if packed_refs.stat is there and
> indicates that packed_refs has not changed, we can make
> create_ref_entry() ignore check_refname_format() completely.

I'm confused. Why would we re-open packed-refs at all if the stat
information hasn't changed?

read_packed_refs is only called from get_packed_ref_cache, and we only
do so if !refs->packed. And refs->packed is only NULL if we haven't read
the file yet, or it is stat-dirty.

If that is working as intended, then we should generally only open and
read packed-refs once per invocation of git.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]