{"thread":{"id":"4958","subject":"[PATCH] show-branch: Fix another performance problem.","startedAt":"2006-07-23T17:51:04Z","lastAt":"2006-07-24T06:46:55Z","messageCount":2,"participants":["Alexandre Julliard","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"24020","messageId":"87mzb0fbw7.fsf@wine.dyndns.org","threadId":"4958","inReplyTo":null,"subject":"[PATCH] show-branch: Fix another performance problem.","fromName":"Alexandre Julliard","fromEmail":"julliard@winehq.org","sentAt":"2006-07-23T17:51:04Z","receivedAt":"2006-07-23T17:51:04Z","isPatch":true,"sender":{"key":"julliard@winehq.org","avatar":null},"body":"When naming commits, stop walking the parent chain as soon as we find\na commit that already has a name. The parent chain of that commit will\nbe walked later on in any case (or may even have been walked already).\nThis avoids O(n^2) behavior; on a tree where show-branch displays 6800\ncommits, the total run time drops from 77 seconds to 5 seconds.\n\nSigned-off-by: Alexandre Julliard <julliard@winehq.org>\n---\n builtin-show-branch.c |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-show-branch.c b/builtin-show-branch.c\nindex 3d240ca..82f75b7 100644\n--- a/builtin-show-branch.c\n+++ b/builtin-show-branch.c\n@@ -89,6 +89,8 @@ static int name_first_parent_chain(struc\n \t\t\tname_parent(c, p);\n \t\t\ti++;\n \t\t}\n+\t\telse\n+\t\t\tbreak;\n \t\tc = p;\n \t}\n \treturn i;\n-- \n1.4.2.rc1.ge7a0\n\n-- \nAlexandre Julliard\njulliard@winehq.org\n"},{"id":"24047","messageId":"7v64hnfqjk.fsf@assigned-by-dhcp.cox.net","threadId":"4958","inReplyTo":"87mzb0fbw7.fsf@wine.dyndns.org","subject":"Re: [PATCH] show-branch: Fix another performance problem.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-07-24T06:46:55Z","receivedAt":"2006-07-24T06:46:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.\n"}]}