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

Re: XDL_FAST_HASH breaks git on OS X 10.7.3

From
Junio C Hamano <gitster@pobox.com>
Date
May 1, 2012, 06:17 UTC
Message-ID
<7vzk9sbf2l.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAJDDKr778t=CufdtitbrhB-vJ3F=xSpSJ_G8e-VK8qCy8Fcfmg@mail.gmail.com>
David Aguilar <davvid@gmail.com> writes:
Show 5 quoted lines
>> +       if (sizeof(long) == 8) {
>
> Isn't the whole point of this code to be fast?
>
> This should be a compile-time check... conditionals hurt perf.

Depends on how good your compiler is, no? The above if () selects based on a constant expression, so on 64-bit archs with a good compiler, there won't be a jump instruction nor a single opcode for the else clause.

Previous: David Aguilar
Message 9 of 9 in “XDL_FAST_HASH breaks git on OS X 10.7.3”
  1. Brian GernhardtApr 29, 2012
  2. Thomas RastApr 30, 2012
  3. Brian GernhardtMay 1, 2012
  4. Junio C HamanoMay 1, 2012
  5. Junio C HamanoMay 1, 2012
  6. Choose XDL_FAST_HASH code on sizeof(long) instead of __WORDSIZEThomas Rast, May 1, 2012
  7. Junio C HamanoMay 1, 2012
  8. David AguilarMay 1, 2012
  9. Junio C HamanoMay 1, 2012

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.