diff options
author | Jeff King <peff@peff.net> | 2015-04-16 04:48:23 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-04-16 08:15:04 -0700 |
commit | 3446a59b3950d57960e27f8a2c7e41462bd2bcf4 (patch) | |
tree | d3bd30702df73b0fadcb936876fb703de385fef8 /templates | |
parent | Git 2.4.0-rc0 (diff) | |
download | tgif-3446a59b3950d57960e27f8a2c7e41462bd2bcf4.tar.xz |
strbuf_getwholeline: use getc macro
strbuf_getwholeline calls fgetc in a tight loop. Using the
getc form, which can be implemented as a macro, should be
faster (and we do not care about it evaluating our argument
twice, as we just have a plain variable).
On my glibc system, running "git rev-parse
refs/heads/does-not-exist" on a file with an extremely large
(1.6GB) packed-refs file went from (best of 3 runs):
real 0m19.383s
user 0m18.876s
sys 0m0.528s
to:
real 0m18.900s
user 0m18.472s
sys 0m0.448s
for a wall-clock speedup of 2.5%.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'templates')
0 files changed, 0 insertions, 0 deletions