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

Re: [PATCH] mingw: use OpenSSL's SHA-1 routines

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Feb 25, 2017, 00:44 UTC
Message-ID
<CA+55aFxY2CMJxdDs-LGChJFxHmhjnifEoi-aDV3AmDu8goM+rg@mail.gmail.com>
In-Reply-To
<20170210050237.gajicliueuvk6s5d@sigill.intra.peff.net>
On Thu, Feb 9, 2017 at 9:02 PM, Jeff King <peff@peff.net> wrote:
Show 7 quoted lines
>
> I think this is only half the story. A heavy-sha1 workload is faster,
> which is good. But one of the original reasons to prefer blk-sha1 (at
> least on Linux) is that resolving libcrypto.so symbols takes a
> non-trivial amount of time. I just timed it again, and it seems to be
> consistently 1ms slower to run "git rev-parse --git-dir" on my machine
> (from the top-level of a repo).
Yes. It's also a horrible plain to profile those things.
Avoiding openssl was a great thing, because it avoided a lot of crazy overhead.

I suspect that most of the openssl win comes from using the actual SHA instructions on modern CPU's. Because last I looked, the hand-coded assembly simply wasn't that much faster.

We could easily have some x86-specific library that just does "use SHA instructions if you have them, use blk-sha1 otherwise".

Of course, if we end up using the collision checking SHA libraries this is all moot anyway.

                 Linus
Previous: Junio C Hamano
Message 18 of 18 in “mingw: use OpenSSL's SHA-1 routines”
  1. mingw: use OpenSSL's SHA-1 routinesJohannes Schindelin, Feb 9, 2017
  2. Junio C HamanoFeb 9, 2017
  3. Johannes SixtFeb 11, 2017
  4. Junio C HamanoFeb 11, 2017
  5. Johannes SchindelinFeb 13, 2017
  6. Johannes SixtFeb 16, 2017
  7. Jeff KingFeb 10, 2017
  8. Johannes SchindelinFeb 10, 2017
  9. Jeff KingFeb 10, 2017
  10. Johannes SixtFeb 13, 2017
  11. Junio C HamanoFeb 13, 2017
  12. Johannes SixtFeb 13, 2017
  13. Johannes SchindelinFeb 13, 2017
  14. Johannes SixtFeb 14, 2017
  15. Junio C HamanoFeb 24, 2017
  16. Johannes SixtMar 2, 2017
  17. Junio C HamanoMar 2, 2017
  18. Linus TorvaldsFeb 25, 2017

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.