]> git.ipfire.org Git - thirdparty/git.git/commit - refs.c
refs.c: optimize check_refname_component()
authorDavid Turner <dturner@twopensource.com>
Wed, 4 Jun 2014 03:38:10 +0000 (23:38 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 5 Jun 2014 22:24:50 +0000 (15:24 -0700)
commitdde8a902c774268628015705a7767f61af18b865
tree063e41ca57518a1e61774f5f5bab1f51c528e083
parent79dcccc503ac228630ecf15dcf8e1d9455daef2d
refs.c: optimize check_refname_component()

In a repository with many refs, check_refname_component can be a major
contributor to the runtime of some git commands. One such command is

git rev-parse HEAD

Timings for one particular repo, with about 60k refs, almost all
packed, are:

Old: 35 ms
New: 29 ms

Many other commands which read refs are also sped up.

Signed-off-by: David Turner <dturner@twitter.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
t/t5511-refspec.sh