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

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

From
Johannes Sixt <j6t@kdbg.org>
Date
Feb 13, 2017, 17:46 UTC
Message-ID
<9913e513-553e-eba6-e81a-9c21030dd767@kdbg.org>
In-Reply-To
<20170210160458.pcp7mupdz24m6cms@sigill.intra.peff.net>
Am 10.02.2017 um 17:04 schrieb Jeff King:
Show 24 quoted lines
> On Fri, Feb 10, 2017 at 04:49:02PM +0100, Johannes Schindelin wrote:
>
>>> 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).
>>>
>>> 1ms is mostly irrelevant, but it adds up on scripted workloads that
>>> start a lot of git processes.
>>
>> You know my answer to that. If scripting slows things down, we should
>> avoid it in production code. As it is, scripting slows us down. Therefore
>> I work slowly but steadily to get rid of scripting where it hurts most.
>
> Well, yes. My question is more "what does it look like on normal Git
> workloads?". Are you trading off an optimization for your giant 450MB
> index workload (which _also_ could be fixed by trying do the slow
> operation less, rather than micro-optimizing it) in a way that hurts
> people working with more normal sized repos?
>
> For instance, "make BLK_SHA1=Yes test" is measurably faster for me than
> "make BLK_SHA1= test".

The patch does add a new runtime dependency on libcrypto.dll in my environment. I would be surprised if it does not also with your modern build tools.

I haven't had time to compare test suite runtimes.
> I'm open to the argument that it doesn't matter in practice for normal
> git users. But it's not _just_ scripting. It depends on the user's
> pattern of invoking git commands (and how expensive the symbol
> resolution is on their system).

It can be argued that in normal interactive use, it is hard to notice that another DLL is loaded. Don't forget, though, that on Windows it is not only the pure time to resolve the entry points, but also that typically virus scanners inspect every executable file that is loaded, which adds another share of time.

I'll use the patch for daily work for a while to see whether it hurts.
-- Hannes
Previous: Jeff KingNext: Junio C Hamano
Message 10 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.