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

Re: [External Mail]Re: why git is so slow for a tiny git push?

From
Jeff King <peff@peff.net>
Date
Nov 24, 2021, 18:15 UTC
Message-ID
<YZ6BJpAY4ZAWaqkr@coredump.intra.peff.net>
In-Reply-To
<56994f02ed4542b89cc6f9586d703e05@xiaomi.com>
On Tue, Nov 23, 2021 at 06:42:12AM +0000, 程洋 wrote:
> I got another problem here.
> When I tries to clone from remote server. It took me 25 seconds to enumerating objects. And then 1 second to `couting objects` by bitmap.
> I don't understand, why a fresh clone need `enumerating objects` ? Is `couting objects` enough for the server to determine what to send?

In older versions of Git, the "counting objects" progress meter used to be the actual object graph traversal. That changed in v2.18 (via 5af050437a), but you may still seem some reference to "counting objects is expensive".

These days that is called "enumerating objects", and "counting objects" is just doing a quick-ish pass over that list to do some light analysis (e.g., if we can reuse an on-disk delta). I'd expect "enumerating" to be expensive in general, and "counting" to be quick in general.

The "enumerating" phase is where we determine what to send whether it's for a clone or a fetch, and may involve opening up a bunch of trees to walk the graph. It's what reachability bitmaps are supposed to make faster. But if you have 300k refs, as you've mentioned, you almost certainly don't have complete coverage of all of the ref tips, so we'll have to fallback to doing at least a partial graph traversal.

Taylor (cc'd) has been looking at some tricks for speeding up cases like this with a lot of refs. But I don't think there's anything to show publicly yet.

-Peff
Previous: 程洋Next: 程洋
Message 13 of 16 in “why git is so slow for a tiny git push?”
  1. 程洋Oct 9, 2021
  2. Jeff KingOct 11, 2021
  3. 程洋Oct 12, 2021
  4. Jeff KingOct 12, 2021
  5. 程洋Oct 12, 2021
  6. Jeff KingOct 12, 2021
  7. 程洋Oct 14, 2021
  8. Jeff KingOct 26, 2021
  9. 程洋Oct 27, 2021
  10. Ævar Arnfjörð BjarmasonOct 12, 2021
  11. Jeff KingOct 12, 2021
  12. 程洋Nov 23, 2021
  13. Jeff KingNov 24, 2021
  14. 程洋Nov 25, 2021
  15. 程洋Nov 24, 2021
  16. Han-Wen NienhuysOct 28, 2021

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.