aboutsummaryrefslogtreecommitdiff
path: root/imap-send.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-05-19 02:12:12 -0400
committerJunio C Hamano <gitster@pobox.com>2017-05-20 18:18:45 +0900
commit613a0e52ea11c4496e3e154de192486a18eac2e4 (patch)
treeba35570dbd632ef85686276574abf025a0487296 /imap-send.c
parentac5bbc02b8c3781d517f1414655270b3fa38b028 (diff)
downloadgit-613a0e52ea11c4496e3e154de192486a18eac2e4.tar.gz
git-613a0e52ea11c4496e3e154de192486a18eac2e4.tar.xz
ref-filter: resolve HEAD when parsing %(HEAD) atom
If the user asks to display (or sort by) the %(HEAD) atom, ref-filter has to compare each refname to the value of HEAD. We do so by resolving HEAD fresh when calling populate_value() on each ref. If there are a large number of refs, this can have a measurable impact on runtime. Instead, let's resolve HEAD once when we realize we need the %(HEAD) atom, allowing us to do a simple string comparison for each ref. On a repository with 3000 branches (high, but an actual example found in the wild) this drops the best-of-five time to run "git branch >/dev/null" from 59ms to 48ms (~20% savings). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'imap-send.c')
0 files changed, 0 insertions, 0 deletions