author | Julian Phillips <julian@quantumfyre.co.uk> | |
Thu, 17 Sep 2009 07:33:19 +0000 (08:33 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 18 Sep 2009 23:32:33 +0000 (16:32 -0700) | ||
commit | e984c54ada086e7676419b6b1b8a2d7a2429da48 | |
tree | 34f5a36c98b2f7daef4ff7f4ba9442aa659b0448 | tree | snapshot |
parent | 8426f672fc65239135b1f1580bb79ecb16fd05f0 | commit | diff |
fetch: Speed up fetch by rewriting find_non_local_tags
When trying to get a list of remote tags to see if we need to fetch
any we were doing a linear search for the matching tag ref for the
tag^{} commit entries. This proves to be incredibly slow for large
numbers of tags. Rewrite the function so that we build up a
string_list of refs to fetch and then process that instead.
As an extreme example, for a repository with 50000 tags (and just a
single commit on a single branch), a fetch that does nothing goes from
~1m50s to ~4.1s.
Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When trying to get a list of remote tags to see if we need to fetch
any we were doing a linear search for the matching tag ref for the
tag^{} commit entries. This proves to be incredibly slow for large
numbers of tags. Rewrite the function so that we build up a
string_list of refs to fetch and then process that instead.
As an extreme example, for a repository with 50000 tags (and just a
single commit on a single branch), a fetch that does nothing goes from
~1m50s to ~4.1s.
Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-fetch.c | diff | blob | history |