summaryrefslogtreecommitdiff
path: root/grep.h
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2009-01-20 04:30:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-01-20 05:34:46 (GMT)
commit2c2dc7c82cea66c5030583233c73593e0f5a8fdb (patch)
tree1c3d0d5ac36121ab6805295d77f32331cba11c1a /grep.h
parentc002922adce90b69ac56a86eeb77b249afa88eb2 (diff)
downloadgit-2c2dc7c82cea66c5030583233c73593e0f5a8fdb.zip
git-2c2dc7c82cea66c5030583233c73593e0f5a8fdb.tar.gz
git-2c2dc7c82cea66c5030583233c73593e0f5a8fdb.tar.bz2
Optimize color_parse_mem
Commit 5ef8d77a implemented color_parse_mem, a function for parsing colors from a non-NUL-terminated string, by simply allocating a new NUL-terminated string and calling color_parse. This had a small but measurable speed impact on a user format that used the advanced color parsing. E.g., # uses quick parsing $ time ./git log --pretty=tformat:'%Credfoo%Creset' >/dev/null real 0m0.673s user 0m0.652s sys 0m0.016s # uses color_parse_mem $ time ./git log --pretty=tformat:'%C(red)foo%C(reset)' >/dev/null real 0m0.692s user 0m0.660s sys 0m0.032s This patch implements color_parse_mem as the primary function, with color_parse as a wrapper for strings. This gives comparable timings to the first case above. Original patch by René. Commit message and debugging by Jeff King. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'grep.h')
0 files changed, 0 insertions, 0 deletions