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

Re: [PATCH v6 2/2] refs.c: SSE4.2 optimizations for check_refname_component

From
David Turner <dturner@twopensource.com>
Date
Jun 4, 2014, 21:16 UTC
Message-ID
<1401916560.18134.167.camel@stross>
In-Reply-To
<538F2C6B.2030004@web.de>
On Wed, 2014-06-04 at 16:25 +0200, Torsten Bögershausen wrote:
Show 11 quoted lines
> On the other hand, looking here: 
> http://sourceware.org/ml/libc-alpha/2009-10/msg00063.html
> and looking into refs.c,
> it seems as if we can try to run 
> strcspn(refname, bad_characters)
> and 
> strstr(refname, "@{"
> and 
> strstr(refname, ".."
> on each refname, instead of checking each char in a loop.
> The library will pick the fastest version for strcspn() automatically.

Yes, you could try that, but I worry that it would be less efficient, because it duplicates the looping machinery.

> David, the repo you run the tests on, is it public?
Unfortunately, it is an internal Twitter repo.
> Or is there a public repo with this many refs ?
I do not know of one.
> Or can you make a dummy repo with 60k refs ?

Sure! I actually went with > 120k to make measurement easier: https://github.com/dturner-tw/many-refs

Previous: Torsten BögershausenNext: Torsten Bögershausen
Message 6 of 14 in “refs.c: optimize check_refname_component()”
  1. 1/2 refs.c: optimize check_refname_component()David Turner, Jun 4, 2014
  2. 2/2 refs.c: SSE4.2 optimizations for check_refname_componentDavid Turner, Jun 4, 2014
  3. Torsten BögershausenJun 4, 2014
  4. Duy NguyenJun 4, 2014
  5. Torsten BögershausenJun 4, 2014
  6. David TurnerJun 4, 2014
  7. Torsten BögershausenJun 5, 2014
  8. Ondřej BílkaJun 5, 2014
  9. David TurnerJun 5, 2014
  10. Torsten BögershausenJun 5, 2014
  11. David TurnerJun 5, 2014
  12. David TurnerJun 4, 2014
  13. Junio C HamanoJun 4, 2014
  14. David TurnerJun 5, 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.