{"thread":{"id":"12775","subject":"strange git delays","startedAt":"2008-03-20T13:32:48Z","lastAt":"2008-03-20T21:53:33Z","messageCount":4,"participants":["James Utter","Johannes Sixt","Johannes Schindelin","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"72512","messageId":"1206019968.27619.26.camel@localhost","threadId":"12775","inReplyTo":null,"subject":"strange git delays","fromName":"James Utter","fromEmail":"james.utter@gmail.com","sentAt":"2008-03-20T13:32:48Z","receivedAt":"2008-03-20T13:32:48Z","isPatch":false,"sender":{"key":"james.utter@gmail.com","avatar":null},"body":"Hi,\n\nMany git operations are running really slowly for me.\nFor example 'git commit' and 'git branch' are taking 10 seconds to\ncomplete, even on an almost empty repository, and no longer on a 60MB\nrepository with plenty of history.\n\nThere does not appear to be any CPU or disk activity caused by git.\n\nI would appreciate your help in resolving this problem.\n\nRegards,\n\nJames Utter\n\n\nDetails of my environment:\n-------------------------------\nLinux 2.6.24-1-amd64 #1 SMP x86_64 (from debian testing) [1]\ngit-core 1:1.5.4.3-1 (from debian testing) [2]\nCore 2 duo, 2Ghz\n\n[1] I have been experiencing this problem across several kernels\n[2] possibly over several git versions too (not sure)\n\nHere is a test run on my computer\n---------------------------------\njames@timesink:~$ mkdir testgit\njames@timesink:~$ cd testgit/\njames@timesink:~/testgit$ time git init-db\nInitialized empty Git repository in .git/\n\nreal\t0m0.013s\nuser\t0m0.000s\nsys\t0m0.008s\njames@timesink:~/testgit$ echo \"hai there\" > hello\njames@timesink:~/testgit$ time git add .\n\nreal\t0m0.103s\nuser\t0m0.000s\nsys\t0m0.004s\njames@timesink:~/testgit$ time git commit --message \"initial commit\"\nCreated initial commit 4f4b3a3: initial commit\n 1 files changed, 1 insertions(+), 0 deletions(-)\n create mode 100644 hello\n\nreal\t0m10.008s\nuser\t0m0.000s\nsys\t0m0.008s\njames@timesink:~/testgit$ time git branch new\n\nreal\t0m10.006s\nuser\t0m0.000s\nsys\t0m0.004s\njames@timesink:~/testgit$ time git branch -d new\nDeleted branch new.\n\nreal\t0m0.005s\nuser\t0m0.000s\nsys\t0m0.004s\njames@timesink:~/testgit$ echo \"im in ur git\\n slowin ur workflo\" >>\nhello\njames@timesink:~/testgit$ time git commit -a --message \"how long\"\nCreated commit 2392de6: how long\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\nreal\t0m10.059s\nuser\t0m0.000s\nsys\t0m0.008s\n"},{"id":"72514","messageId":"47E26F26.10301@viscovery.net","threadId":"12775","inReplyTo":"1206019968.27619.26.camel@localhost","subject":"Re: strange git delays","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-03-20T14:05:26Z","receivedAt":"2008-03-20T14:05:26Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"James Utter schrieb:\n> Many git operations are running really slowly for me.\n> For example 'git commit' and 'git branch' are taking 10 seconds to\n> complete, even on an almost empty repository, and no longer on a 60MB\n> repository with plenty of history.\n> \n> There does not appear to be any CPU or disk activity caused by git.\n\n...\n\n> james@timesink:~/testgit$ time git commit --message \"initial commit\"\n> Created initial commit 4f4b3a3: initial commit\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n>  create mode 100644 hello\n> \n> real\t0m10.008s\n> user\t0m0.000s\n> sys\t0m0.008s\n\nWhat does\n\n  strace -c git commit --message \"initial commit\"\n\nreport? 'strace -tt' or 'strace -T'?\n\n-- Hannes\n"},{"id":"72515","messageId":"alpine.LSU.1.00.0803201518520.4124@racer.site","threadId":"12775","inReplyTo":"1206019968.27619.26.camel@localhost","subject":"Re: strange git delays","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-03-20T14:19:29Z","receivedAt":"2008-03-20T14:19:29Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 21 Mar 2008, James Utter wrote:\n\n> james@timesink:~/testgit$ time git commit --message \"initial commit\"\n> Created initial commit 4f4b3a3: initial commit\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n>  create mode 100644 hello\n> \n> real\t0m10.008s\n> user\t0m0.000s\n> sys\t0m0.008s\n\nI'd try to oprofile it to know what is taking so long.\n\nHth,\nDscho\n"},{"id":"72541","messageId":"alpine.LFD.1.00.0803201441270.3020@woody.linux-foundation.org","threadId":"12775","inReplyTo":"1206019968.27619.26.camel@localhost","subject":"Re: strange git delays","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-03-20T21:53:33Z","receivedAt":"2008-03-20T21:53:33Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 21 Mar 2008, James Utter wrote:\n>\n> james@timesink:~/testgit$ time git commit --message \"initial commit\"\n> Created initial commit 4f4b3a3: initial commit\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n>  create mode 100644 hello\n> \n> real\t0m10.008s\n> user\t0m0.000s\n> sys\t0m0.008s\n\nOk, that is almost exactly 10 seconds longer than it should take.\n\nAnd I can almost guarantee that it's something like a problem looking up \nyour hostname or perhaps user identity - I would guess you have some name \nservice problem.\n\nDo an\n\n\tstrace -tT git commit --message \"initial commit\"\n\non that git commit to make sure, but I would almost bet that it's when git \ndoes tget \"getpwuid()\" thing to get your name from the gecos fields, and \nyou have some setup problem with nscd o similar.\n\nIt might just go away if you set up your user name and email manually, ie \ntry doing\n\n\tgit config --global user.name \"James Utter\"\n\tgit config --global user.email james.utter@gmail.com\n\nand see if that makes the delay go away. It probably tries to look up your \nlogin info from some non-existent NIS setup, and then times out after ten \nseconds and picks the data from your /etc/passwd file instead.\n\n(There can be other things that do similar things - misconfigured name \nservers etc can cause delay etc. So maybe I'm wrogn on blaming nscd, but \nit would be my first guess).\n\n\t\tLinus\n"}]}