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

1 messages from 2018-04-10 to 2018-04-10. Participants: Ofer Koren.
Thread: https://gitlist.dev/t/48255

## Ofer Koren, 2018-04-10 09:57

Subject: git log slow - due to fetching ref name prefixes despite format string not needing them
Message-ID: <CAOt29zrv1Wnu8ZWnY9NZS5J36=16r0t=gMCM3_94SFC_fovnfA@mail.gmail.com>
URL: https://gitlist.dev/e/CAOt29zrv1Wnu8ZWnY9NZS5J36%3D16r0t%3DgMCM3_94SFC_fovnfA%40mail.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

```
