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

Slow "git rev-list origin/master --not --all" or "git fetch" slow when downloading nothing

From
SBSanti Béjar <santi@agolina.net>
Date
Nov 5, 2008, 09:38 UTC
Message-ID
<adf1fd3d0811050138j7b8bbed1nd94a999f55e38d61@mail.gmail.com>
Hi *,
  In cold cache "git rev-list origin/master --not --all" is slow
reading many files:

cold cache: $ /usr/bin/time git rev-list origin/master --not --all 0.03user 0.02system 0:04.57elapsed 1%CPU (0avgtext+0avgdata 0maxresident)k 77848inputs+0outputs (410major+1798minor)pagefaults 0swaps

hot cache: $ /usr/bin/time git rev-list origin/master --not --all 0.01user 0.00system 0:00.06elapsed 31%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+2207minor)pagefaults 0swaps

I think that, in this particular case (when the arguments are the tips of some of the branches), this should not read that many files.

Moreover, this is used in "git fetch" (git rev-list --quiet --objects <list_of_remote_sha1> --not --all) to detect if all the objects are reachable from the local repository. When nothing has changed in the remote repository (so refs/<remote>/* has all the remote refs) the "git fetch" could be almost instantaneous (even in coldcache), but currently it is not because of the above.

Thanks, Santi

Next: Junio C Hamano
Message 1 of 5 in “Slow "git rev-list origin/master --not --all" or "git fetch" slow when downloading nothing”
  1. Santi BéjarNov 5, 2008
  2. Re* Slow "git rev-list origin/master --not --all" or "git fetch" slow when downloading nothingJunio C Hamano, Nov 5, 2008
  3. Linus TorvaldsNov 5, 2008
  4. Santi BéjarNov 5, 2008
  5. Linus TorvaldsNov 5, 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.