On Thu, May 29, 2014 at 11:36 PM, Junio C Hamano <gits...@pobox.com> wrote:
> Duy Nguyen <pclo...@gmail.com> writes:
>
>> On Thu, May 29, 2014 at 6:49 AM, David Turner <dtur...@twopensource.com> 
>> wrote:
>>>> I assume that most of the time spent in check_refname_component() is
>>>> while reading the packed-refs file, right?
>>>
>>> Yes.
>>
>> 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. That's
even cheaper than SSE-enhanced check_refname_component() and easier to
do. If packed_refs is updated, we do the whole check_refname_format
dance again.
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to