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

Re: How to unpack recent objects?

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 16, 2010, 22:18 UTC
Message-ID
<m339r0ncai.fsf@localhost.localdomain>
In-Reply-To
<4D0A8D83.9080705@cfl.rr.com>
Phillip Susi <psusi@cfl.rr.com> writes:
> On 12/16/2010 4:19 PM, Nicolas Pitre wrote:
Show 8 quoted lines
> > What makes you think that unpacking them will actually make the access 
> > to them faster?  Instead, you should consider _repacking_ them, 
> > ultimately using the --aggressive parameter with the gc command, if you 
> > want faster accesses.
> 
> Because decompressing and undeltifying the objects in the pack file
> takes a fair amount of cpu time.  It seems a waste to do this for the
> same set of objects repeatedly rather than just keeping them loose.
Loose objects are also compressed.  

Besides git has some kind of delta cache, so when you are accessing a few objects (like e.g. when doing 'git log -p' - log + diff) you don't need to undeltify and uncompress the same objects repeatedly.

Also in practice it is IO that is bottleneck, not CPU. And having many files is bad for filesystem cache. Originally packfiles were for the network transfer, but it turned out that they are better also as on-disk format.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Phillip SusiNext: Nicolas Pitre
Message 5 of 6 in “How to unpack recent objects?”
  1. Phillip SusiDec 16, 2010
  2. Jonathan NiederDec 16, 2010
  3. Nicolas PitreDec 16, 2010
  4. Phillip SusiDec 16, 2010
  5. Jakub NarebskiDec 16, 2010
  6. Nicolas PitreDec 16, 2010

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.