author | Sergey Vlasov <vsu@altlinux.ru> | |
Wed, 21 Sep 2005 16:33:59 +0000 (20:33 +0400) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 21 Sep 2005 19:32:32 +0000 (12:32 -0700) | ||
commit | f9cff269122432c4de47341f16c1661c7492d398 | |
tree | 594a802bdbada450bd4b10a98a116a57794d0f9e | tree | snapshot |
parent | e8d2a6d483a6f556a509fc8debdb9391a5fa2630 | commit | diff |
[PATCH] fetch.c: Make process() look at each object only once
The process() function is very often called multiple times for the
same object (because lots of trees refer to the same blobs), but did
not have a fast check for this, therefore a lot of useless calls to
has_sha1_file() and parse_object() were made before discovering that
nothing needs to be done.
This patch adds the SEEN flag which is used in process() to make it
look at each object only once. When testing git-local-fetch on the
repository of GIT, this gives a 14x improvement in CPU usage (mainly
because the redundant calls to parse_object() are now avoided -
parse_object() always unpacks and parses the object data, even if it
was already parsed before).
Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
The process() function is very often called multiple times for the
same object (because lots of trees refer to the same blobs), but did
not have a fast check for this, therefore a lot of useless calls to
has_sha1_file() and parse_object() were made before discovering that
nothing needs to be done.
This patch adds the SEEN flag which is used in process() to make it
look at each object only once. When testing git-local-fetch on the
repository of GIT, this gives a 14x improvement in CPU usage (mainly
because the redundant calls to parse_object() are now avoided -
parse_object() always unpacks and parses the object data, even if it
was already parsed before).
Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
fetch.c | diff | blob | history |