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

Re: Git status extremely slow if any file is a multiple of 8GBi

From
Junio C Hamano <gitster@pobox.com>
Date
May 4, 2022, 16:08 UTC
Message-ID
<xmqq4k25nuvj.fsf@gitster.g>
In-Reply-To
<xmqqczgtpfl5.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 7 quoted lines
> The condition sd_size==0 is used as a signal for "no, we really need
> to compare the contents", and causes the contents to be hashed, and
> if the contents match the object name recorded in the index, the
> on-disk size is stored in sd_size and the entry is marked as
> CE_UPTODATE.  Alas, if the truncated st_size is 0, the resulting
> entry would have sd_size==0 again, so a workaround like what you
> outlined is needed.

This is of secondary importance, but the fact that Jason observed 8GBi files gets hashed over and over unnecessarily means that we would do the same for an empty file, opening, reading 0-bytes, hashing, and closing, without taking advantage of the fact that CE_UPTODATE bit says the file contents should be up-to-date with respect to the cached object name, doesn't it?

Or do we have "if st_size == 0 and sd_size == 0 then we know what it hashes to (i.e. EMPTY_BLOB_SHA*) and there is no need to do the usual open-read-hash-close dance" logic (I didn't check)?

Previous: Junio C Hamano
Message 3 of 3 in “Git status extremely slow if any file is a multiple of 8GBi”
  1. Jason HattonMay 4, 2022
  2. Junio C HamanoMay 4, 2022
  3. Junio C HamanoMay 4, 2022

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.