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

Re: SHA-accelerated Git

From
Michal Suchánek <msuchanek@suse.de>
Date
Jun 2, 2019, 11:21 UTC
Message-ID
<20190602132150.4c1b320f@naga.suse.cz>
In-Reply-To
<CAH8yC8nMcVuLeLWrVumLaz2Pbi3GugzgY-Bw3SMipjJkaph85Q@mail.gmail.com>
Hello,

On Sun, 2 Jun 2019 06:43:07 -0400 Jeffrey Walton <noloader@gmail.com> wrote:

> Hi Everyone,
> 
> I have a lot of experience with cutting in SHA acceleration. I have no
> experience with Git.

sha1 is dead. Git is planning to move away from it. It will not happen overnight but it probably does not make sense to accelerate it at this point.

https://github.com/git/git/blob/next/Documentation/technical/hash-function-transition.txt
Show 26 quoted lines
> 
> If someone would setup a fork and provide a call like:
> 
>     // https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/cpufeature.h
>     // Or whatever the project prefers
>     has_x86_sha = cpu_feature_enabled(X86_FEATURE_SHA_NI);
> 
>     if (has_x86_sha)
>     {
>         sha1_hash_block(state, ptr, size);
>     }
> 
> And provide a stub:
> 
>     sha1_hash_block(uint32_t* state, uint8_t* ptr, size_t size)
>     {
>     }
> 
> Then I would be happy to fill in the pieces.
> 
> I can also help with ARMv8.
> 
> In fact, if you want to use Andy Polyakov's asm from Cryptogams
> (https://www.openssl.org/~appro/cryptogams/), then I can help with
> that, too. Andy's skills are renowned and his code is used in the
> kernel.

And buggy. I am not referring to the sha1 implementation in particular but to the hand-crafted assembly in general.

Do you have some performance data that shows significant improvement of common tasks that makes maintaining this hackery worthwhile?

Thanks
Michal
Previous: Jeffrey WaltonNext: Jeffrey Walton
Message 2 of 4 in “SHA-accelerated Git”
  1. Jeffrey WaltonJun 2, 2019
  2. Michal SuchánekJun 2, 2019
  3. Jeffrey WaltonJun 2, 2019
  4. Johannes SchindelinJun 3, 2019

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.