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

Re: [PATCH 0/3] On compresing large index

From
Thomas Rast <trast@inf.ethz.ch>
Date
Feb 5, 2012, 21:22 UTC
Message-ID
<87ehu9ug9i.fsf@thomas.inf.ethz.ch>
In-Reply-To
<1328430605-4566-1-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
Show 9 quoted lines
> $ time ~/w/git/git ls-files | head >/dev/null
> real    0m4.635s
> user    0m4.258s
> sys     0m0.329s
>
> $ time ~/w/git/git update-index level-0-0000/foo
> real    0m4.593s
> user    0m4.264s
> sys     0m0.323s
[...]
> We need to figure out what git uses 4s user time for.

When I worked on the cache-tree stuff, my observation (based on profiling, so I had actual data :-) was that computing SHA1s absolutely dominates everything in such operations. It does that when writing the index to write the trailing checksum, and also when loading it to verify that the index is valid.

ls-files shouldn't be so slow though. A quick run with callgrind in a linux-2.6.git tells me it spends about 45% of its time on SHA1s and a whopping 25% in quote_c_style(). I wonder what's so hard about quoting...

> This series may be useful on OSes that do not cache heavily. Though
> I'm not sure if there is any out there nowadays.
I think you could make a case that they should not be called "OS" ;-)
-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Nguyễn Thái Ngọc DuyNext: Nguyen Thai Ngoc Duy
Message 5 of 7 in “On compresing large index”
  1. 0/3 On compresing large indexNguyễn Thái Ngọc Duy, Feb 5, 2012
  2. 1/3 read-cache: factor out cache entries reading codeNguyễn Thái Ngọc Duy, Feb 5, 2012
  3. 2/3 read-cache: reduce malloc/free during writing indexNguyễn Thái Ngọc Duy, Feb 5, 2012
  4. 3/3 Support compressing index when GIT_ZCACHE=1Nguyễn Thái Ngọc Duy, Feb 5, 2012
  5. Thomas RastFeb 5, 2012
  6. Nguyen Thai Ngoc DuyFeb 6, 2012
  7. Joshua RedstoneFeb 6, 2012

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.