Re: [PATCH v5 2/2] refs.c: SSE4.2 optimizations for check_refname_component
- From
David Turner <dturner@twopensource.com>
- Date
- Jun 4, 2014, 03:35 UTC
- Message-ID
- <1401852911.18134.134.camel@stross>
- In-Reply-To
- <xmqqd2epwsw0.fsf@gitster.dls.corp.google.com>
On Tue, 2014-06-03 at 15:05 -0700, Junio C Hamano wrote:
Show 8 quoted lines
> > + if (((uintptr_t) vp & (PAGE_SIZE - 1)) > PAGE_SIZE - BLOCK_SIZE) > > + /* End-of-page; fall back to slow method for > > + * this entire component. */ > > + return check_refname_component_1(refname, flags); > > It is somewhat sad that we have to redo the whole thing, but nobody > higher in the callchain knows how long the refname will be before > calling us, so this cannot be avoided.
It actually could be avoided; we could pass in some extra args that let check_refname_component_1 start checking after the part that we have already checked. I decided not to do this because I believe that the average refname component is short, which means that the cost is not too high and that it won't happen very often. But I would be willing to change this if you would like.