git/list[1] front-page[2] threads[3] people[4] search[5] about
 

q: git-fetch a tad slow?

From
IMIngo Molnar <mingo@elte.hu>
Date
Jul 28, 2008, 16:01 UTC
Message-ID
<20080728160138.GA12777@elte.hu>
here's another possibly stupid question.

Setup/background: distributed kernel testing cluster, there's a central box with a git repo of the kernel, and lots of of testboxes that track that repo over ssh transport. In each "iteration" a random kernel config is generated, built and booted, and the booted up kernel is checked. Performance of each iteration matters to total testing throughput, so i try to optimize the critical path.

Problem: i noticed that git-fetch is a tad slow:
  titan:~/tip> time git-fetch
 
  real    0m2.372s
  user    0m0.814s
  sys     0m0.951s

There are hundreds of branches, so i thought fetching a single branch alone would improve things:

  titan:~/tip> time git-fetch origin master
  real    0m0.942s
  user    0m0.285s
  sys     0m0.109s
But that's still slow - so i use a (lame) ad-hoc script instead:
  titan:~/tip> time tip-fetch
  real    0m0.246s
  user    0m0.024s
  sys     0m0.019s
... which ssh's to the repo to check tip/master by hand:
  HEAD=$(git-log -1 --pretty=format:"%H" HEAD)
  RHEAD=$(ssh server "cd tip; git-log master -1 --pretty=format:'%H'")
  [ "$RHEAD" != "$HEAD" ] && {
    [...]
  }

... which script is lame/expensive on multiple levels but still is much faster.

I'm wondering, am i missing something obvious? It seems most of the overhead is local CPU overhead, so it's something in Git's domain and not the expense of the ssh protocol. (which expense should be about 200 msecs)

	Ingo
Next: Shawn O. Pearce
Message 1 of 10 in “q: git-fetch a tad slow?”
  1. Ingo MolnarJul 28, 2008
  2. Shawn O. PearceJul 29, 2008
  3. Ingo MolnarJul 29, 2008
  4. Shawn O. PearceJul 30, 2008
  5. Ingo MolnarJul 30, 2008
  6. Shawn O. PearceJul 30, 2008
  7. Shawn O. PearceJul 31, 2008
  8. Ingo MolnarJul 31, 2008
  9. Ingo MolnarJul 31, 2008
  10. Shawn O. PearceJul 31, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.