git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 5 in “refs.c: optimize check_refname_component()”
  1. 1/2 refs.c: optimize check_refname_component()David Turner, Jun 2, 2014
  2. 2/2 refs.c: SSE4.2 optimizations for check_refname_componentDavid Turner, Jun 2, 2014
  3. Junio C HamanoJun 3, 2014
  4. David TurnerJun 4, 2014
  5. Junio C HamanoJun 3, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.