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

git log slow - due to fetching ref name prefixes despite format string not needing them

From
OKOfer Koren <ofer@weka.io>
Date
Apr 10, 2018, 09:57 UTC
Message-ID
<CAOt29zrv1Wnu8ZWnY9NZS5J36=16r0t=gMCM3_94SFC_fovnfA@mail.gmail.com>

---------------- Slow:

>> time git log --oneline --no-color --format="%h %ae %at" bd4d00302a^1..bd4d00302a^2

1049ee2882 eyal@weka.io 1518954558 c0e107f167 eyal@weka.io 1518954522

real 0m0.119s user 0m0.104s sys 0m0.012s

---------------- Fast:

>> time git log --no-decorate --oneline --no-color --format="%h %ae %at" bd4d00302a^1..bd4d00302a^2

1049ee2882 eyal@weka.io 1518954558 c0e107f167 eyal@weka.io 1518954522

real 0m0.011s user 0m0.004s sys 0m0.004s

---------------- As you can see the output is identical, but the first execution is 10 times slower. Using strace I've found the cause of the difference to be traversal of the '.git/refs/heads/*' folders.

Regards,
- Ofer Koren
Message 1 of 1 in “git log slow - due to fetching ref name prefixes despite format string not needing them”
  1. Ofer KorenApr 10, 2018

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.