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

Re: [PATCH] fast-import: use hashcmp() for SHA1 hash comparison

From
Jeff King <peff@peff.net>
Date
Jul 18, 2014, 23:57 UTC
Message-ID
<20140718235706.GA11192@peff.net>
In-Reply-To
<53C971FD.6040500@web.de>
On Fri, Jul 18, 2014 at 09:14:05PM +0200, René Scharfe wrote:
Show 5 quoted lines
> If inlining is really better is another matter; I don't understand how
> 1a812f3a (hashcmp(): inline memcmp() by hand to optimize) could have made
> git gc 18% faster, as it claimed.  I would expect memcmp(), which can
> compare more than a byte at a time, to be significantly faster -- or at
> least just as fast as whatever the compiler does with the inlined version.

I looked into this a while ago[1]. I think with glibc 2.13 and up, the memcmp is a win. We should consider switching back if that is what is common now.

-Peff
[1] http://article.gmane.org/gmane.comp.version-control.git/218396
Previous: René ScharfeNext: René Scharfe
Message 4 of 7 in “fast-import: use hashcmp() for SHA1 hash comparison”
  1. fast-import: use hashcmp() for SHA1 hash comparisonRené Scharfe, Jul 18, 2014
  2. Jonathan NiederJul 18, 2014
  3. René ScharfeJul 18, 2014
  4. Jeff KingJul 18, 2014
  5. René ScharfeJul 19, 2014
  6. brian m. carlsonJul 19, 2014
  7. René ScharfeJul 19, 2014

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.