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

2014-06-03 Thread David Turner
On Tue, 2014-06-03 at 15:05 -0700, Junio C Hamano wrote: > > + 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_re

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

2014-06-03 Thread Junio C Hamano
David Turner writes: > diff --git a/git-compat-util.h b/git-compat-util.h > index f6d3a46..254487a 100644 > --- a/git-compat-util.h > +++ b/git-compat-util.h > @@ -668,6 +668,26 @@ void git_qsort(void *base, size_t nmemb, size_t size, > #endif > #endif > > +#ifndef NO_SSE42 > +#include > +/*

[PATCH v5 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

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

2014-06-01 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