From: "Torsten Bögershausen" <tboegi@web.de>
To: "Duy Nguyen" <pclouds@gmail.com>, "Torsten Bögershausen" <tboegi@web.de>
Cc: David Turner <dturner@twopensource.com>,
Git Mailing List <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>,
Michael Haggerty <mhagger@alum.mit.edu>,
David Turner <dturner@twitter.com>
Subject: Re: [PATCH v6 2/2] refs.c: SSE4.2 optimizations for check_refname_component
Date: Wed, 04 Jun 2014 16:25:47 +0200 [thread overview]
Message-ID: <538F2C6B.2030004@web.de> (raw)
In-Reply-To: <CACsJy8CK3LNaPVNv=EfFX06uOgpujAz364ZDFL3HBPicDNF57w@mail.gmail.com>
On 2014-06-04 13.21, Duy Nguyen wrote:
> On Wed, Jun 4, 2014 at 3:04 PM, Torsten Bögershausen <tboegi@web.de> 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/win32mmap.o
>>> endif
>>> endif
>>> +ifdef NO_SSE42
>>> + BASIC_CFLAGS += -DNO_SSE42
>>> +else
>>> + BASIC_CFLAGS += -msse4.2
>>> +endif
>> This does work for some people, but break for others, like the systems in my test-lab.
>> On 2 different systems the gcc has support for -msse4.2, but the processor has not,
>> and t5511 fails with "Illegal instruction".
>> How can that be?
>> The maintainer of a Linux distro wants to ship gcc with all possible features,
>> an the end-user can compile the code with all the features his very processor has.
>
> I think glibc code uses cpuid instruction to decide whether to use
> optimized version. May be we can do the same? If we go that route and
> have a way to detect sse support from compiler, then we can drop
> NO_SSE42, enable all and pick one at runtime.
>
Running make under a non-X86 processor like arm fails, as his gcc does not have -msse4.2
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.
David, the repo you run the tests on, is it public?
Or is there a public repo with this many refs ?
Or can you make a dummy repo with 60k refs ?
next prev parent reply other threads:[~2014-06-04 14:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-04 3:38 [PATCH v6 1/2] refs.c: optimize check_refname_component() David Turner
2014-06-04 3:38 ` [PATCH v6 2/2] refs.c: SSE4.2 optimizations for check_refname_component David Turner
2014-06-04 8:04 ` Torsten Bögershausen
2014-06-04 11:21 ` Duy Nguyen
2014-06-04 14:25 ` Torsten Bögershausen [this message]
2014-06-04 21:16 ` David Turner
2014-06-05 12:30 ` Torsten Bögershausen
2014-06-05 12:58 ` Ondřej Bílka
2014-06-05 19:26 ` David Turner
2014-06-05 21:42 ` Torsten Bögershausen
2014-06-05 22:02 ` David Turner
2014-06-04 21:14 ` David Turner
2014-06-04 21:46 ` Junio C Hamano
2014-06-05 19:27 ` David Turner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=538F2C6B.2030004@web.de \
--to=tboegi@web.de \
--cc=dturner@twitter.com \
--cc=dturner@twopensource.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mhagger@alum.mit.edu \
--cc=pclouds@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).