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

Re: git-fetching from a big repository is slow

From
Andreas Ericsson <ae@op5.se>
Date
Dec 14, 2006, 22:28 UTC
Message-ID
<4581D01E.9020806@op5.se>
In-Reply-To
<C287764F-6755-4291-A87A-3E8816E90B49@adacore.com>
Geert Bosch wrote:
Show 20 quoted lines
> 
> On Dec 14, 2006, at 10:06, Andreas Ericsson wrote:
> 
>> It wouldn't work for this particular case though. In our distribution 
>> repository we have ~300 bzip2 compressed tarballs with an average size 
>> of 3MiB. 240 of those are between 2.5 and 4 MiB, so they don't 
>> drastically differ, but neither do they delta well.
>>
>> One option would be to add some sort of config option to skip 
>> attempting deltas of files with a certain suffix. That way we could 
>> just tell it to ignore *.gz,*.tgz,*.bz2 and everything would work just 
>> as it does today, but a lot faster.
> 
> Such special magic based on filenames is always a bad idea. Tomorrow 
> somebody
> comes with .zip files (oh, and of course .ZIP), then it's .jpg's other
> compressed content. In the end git will be doing lots of magic and still 
> perform
> badly on unknown compressed content.
> 

Hence config option. People can tell git to skip trying to delta whatever they want. For this particular mothership repo, we only ever work against it when we're at the office, meaning resulting datasize is not an issue, but data computation can be a real bottle-neck.

Show 13 quoted lines
> There is a very simple way of detecting compressed files: just look at the
> size of the compressed blob and compare against the size of the expanded 
> blob.
> If the compressed blob has a non-trivial size which is close to the 
> expanded
> size, assume the file is not interesting as source or target for deltas.
> 
> Example:
>    if (compressed_size > expanded_size / 4 * 3 + 1024) {
>      /* don't try to deltify if blob doesn't compress well */
>      return ...;
>    }
> 

Many compression algorithms generate similar output for similar input. Most source-code projects change relatively little between releases, so they *could* delta well, it's just that in our repo they don't.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Previous: Geert BoschNext: Andy Parkins
Message 6 of 14 in “git-fetching from a big repository is slow”
  1. Andy ParkinsDec 14, 2006
  2. Andreas EricssonDec 14, 2006
  3. Johannes SchindelinDec 14, 2006
  4. Andreas EricssonDec 14, 2006
  5. Geert BoschDec 14, 2006
  6. Andreas EricssonDec 14, 2006
  7. Andy ParkinsDec 14, 2006
  8. Han-Wen NienhuysDec 14, 2006
  9. Andy ParkinsDec 14, 2006
  10. Johannes SchindelinDec 14, 2006
  11. Junio C HamanoDec 14, 2006
  12. Johannes SchindelinDec 14, 2006
  13. Junio C HamanoDec 15, 2006
  14. Nicolas PitreDec 14, 2006

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.