author | Anders Kaseorg <andersk@ksplice.com> | |
Thu, 9 Dec 2010 06:47:29 +0000 (01:47 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 9 Dec 2010 19:20:26 +0000 (11:20 -0800) | ||
commit | d1645d02defe43fa5b43140050ba265fcc49fa70 | |
tree | e2bf1c06ade74e1878dc0309df78dc12073849f0 | tree | snapshot |
parent | 3cfa4db3226ccef8845589029090d9398b207ba3 | commit | diff |
describe: Delay looking up commits until searching for an inexact match
Now that struct commit.util is not used until after we've checked that
the argument doesn't exactly match a tag, we can wait until then to
look up the commits for each tag.
This avoids a lot of I/O on --exact-match queries in repositories with
many tags. For example, 'git describe --exact-match HEAD' becomes
about 12 times faster on a cold cache (3.2s instead of 39s) in a
linux-2.6 repository with 2000 packed tags. That is a huge win for the
interactivity of the __git_ps1 shell prompt helper when on a detached
HEAD.
Signed-off-by: Anders Kaseorg <andersk@ksplice.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Now that struct commit.util is not used until after we've checked that
the argument doesn't exactly match a tag, we can wait until then to
look up the commits for each tag.
This avoids a lot of I/O on --exact-match queries in repositories with
many tags. For example, 'git describe --exact-match HEAD' becomes
about 12 times faster on a cold cache (3.2s instead of 39s) in a
linux-2.6 repository with 2000 packed tags. That is a huge win for the
interactivity of the __git_ps1 shell prompt helper when on a detached
HEAD.
Signed-off-by: Anders Kaseorg <andersk@ksplice.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/describe.c | diff | blob | history |