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

2014-06-05 Thread David Turner
On Thu, 2014-06-05 at 23:42 +0200, Torsten Bögershausen wrote: > On 2014-06-05 21.26, David Turner wrote: > > On Thu, 2014-06-05 at 14:30 +0200, Torsten Bögershausen wrote: > >> On 2014-06-04 23.16, David Turner wrote: > >>> > >>> Sure! I actually went with > 120k to make measurement easier: > >>>

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

2014-06-05 Thread Torsten Bögershausen
On 2014-06-05 21.26, David Turner wrote: > On Thu, 2014-06-05 at 14:30 +0200, Torsten Bögershausen wrote: >> On 2014-06-04 23.16, David Turner wrote: >>> >>> Sure! I actually went with > 120k to make measurement easier: >>> https://github.com/dturner-tw/many-refs >> Hm, I didn't get so man >> >> g

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

2014-06-05 Thread David Turner
On Wed, 2014-06-04 at 14:46 -0700, Junio C Hamano wrote: > David Turner writes: > > > On Wed, 2014-06-04 at 10:04 +0200, Torsten Bögershausen wrote: > > [snip discussion of compiler flags; I'll look into a cpuid approach] > > H, I am not sure if the complexity is really worth it. > > In any

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

2014-06-05 Thread David Turner
On Thu, 2014-06-05 at 14:30 +0200, Torsten Bögershausen wrote: > On 2014-06-04 23.16, David Turner wrote: > > > > Sure! I actually went with > 120k to make measurement easier: > > https://github.com/dturner-tw/many-refs > Hm, I didn't get so man > > git remote -v > origin https://github.com/dtu

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

2014-06-05 Thread Ondřej Bílka
On Thu, Jun 05, 2014 at 02:30:17PM +0200, Torsten Bögershausen wrote: > On 2014-06-04 23.16, David Turner wrote: > > > > Sure! I actually went with > 120k to make measurement easier: > > https://github.com/dturner-tw/many-refs > Hm, I didn't get so man > > git remote -v > origin https://github.

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

2014-06-05 Thread Torsten Bögershausen
On 2014-06-04 23.16, David Turner wrote: > > Sure! I actually went with > 120k to make measurement easier: > https://github.com/dturner-tw/many-refs Hm, I didn't get so man git remote -v origin https://github.com/dturner-tw/many-refs wc .git/packed-refs 7501130 38868 .git/packed-

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

2014-06-04 Thread Junio C Hamano
David Turner writes: > On Wed, 2014-06-04 at 10:04 +0200, Torsten Bögershausen wrote: > [snip discussion of compiler flags; I'll look into a cpuid approach] H, I am not sure if the complexity is really worth it. In any case, [PATCH 1/2] is fairly uncontroversial, so I am inclined to queue i

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

2014-06-04 Thread David Turner
On Wed, 2014-06-04 at 16:25 +0200, Torsten Bögershausen wrote: > 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 > str

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

2014-06-04 Thread David Turner
On Wed, 2014-06-04 at 10:04 +0200, Torsten Bögershausen wrote: [snip discussion of compiler flags; I'll look into a cpuid approach] > > --- a/git-compat-util.h > > +++ b/git-compat-util.h > > @@ -668,6 +668,28 @@ void git_qsort(void *base, size_t nmemb, size_t size, > > #endif > > #endif > > >

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

2014-06-04 Thread Torsten Bögershausen
On 2014-06-04 13.21, Duy Nguyen wrote: > On Wed, Jun 4, 2014 at 3:04 PM, Torsten Bögershausen wrote: >> >> On 2014-06-04 05.38, David Turner wrote: >> [] >>> [] >>> diff --git a/Makefile b/Makefile >>> index a53f3a8..dd2127a 100644 >>> --- a/Makefile >>> +++ b/Makefile >>> @@ -1326,6 +1326,11 @@ e

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

2014-06-04 Thread Duy Nguyen
On Wed, Jun 4, 2014 at 3:04 PM, Torsten Bögershausen wrote: > > On 2014-06-04 05.38, David Turner wrote: > [] >> [] >> diff --git a/Makefile b/Makefile >> index a53f3a8..dd2127a 100644 >> --- a/Makefile >> +++ b/Makefile >> @@ -1326,6 +1326,11 @@ else >> COMPAT_OBJS += compat/win32mm

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

2014-06-04 Thread Torsten Bögershausen
On 2014-06-04 05.38, David Turner wrote: [] > [] > diff --git a/Makefile b/Makefile > index a53f3a8..dd2127a 100644 > --- a/Makefile > +++ b/Makefile > @@ -1326,6 +1326,11 @@ else > COMPAT_OBJS += compat/win32mmap.o > endif > endif > +ifdef NO_SSE42 > + BASIC_CFLAGS += -DN

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

2014-06-03 Thread David Turner
Optimize check_refname_component using SSE4.2, where available. git rev-parse HEAD is a good test-case for this, since it does almost nothing except parse refs. For one particular repo with about 60k refs, almost all packed, the timings are: Look up table: 29 ms SSE4.2:25 ms This is abo