summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4812a93)
raw | patch | inline | side by side (parent: 4812a93)
author | Alexandre Julliard <julliard@winehq.org> | |
Sun, 23 Jul 2006 17:51:04 +0000 (19:51 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 24 Jul 2006 06:44:00 +0000 (23:44 -0700) |
When naming commits, stop walking the parent chain as soon as we find
a commit that already has a name. The parent chain of that commit will
be walked later on in any case (or may even have been walked already).
This avoids O(n^2) behavior; on a tree where show-branch displays 6800
commits, the total run time drops from 77 seconds to 5 seconds.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
a commit that already has a name. The parent chain of that commit will
be walked later on in any case (or may even have been walked already).
This avoids O(n^2) behavior; on a tree where show-branch displays 6800
commits, the total run time drops from 77 seconds to 5 seconds.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-show-branch.c | patch | blob | history |
diff --git a/builtin-show-branch.c b/builtin-show-branch.c
index 3d240ca435e3079530dd3515ce78bd20858e3a6f..82f75b72dea1a5e6c620003d5c0c4c414dfe42e3 100644 (file)
--- a/builtin-show-branch.c
+++ b/builtin-show-branch.c
name_parent(c, p);
i++;
}
+ else
+ break;
c = p;
}
return i;