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

Re: [PATCH 2/2] use zstd zlib wrapper

From
Stefan Beller <sbeller@google.com>
Date
Sep 15, 2016, 01:22 UTC
Message-ID
<CAGZ79kYcB-x40_w1fcWL3NSp8JU9SPrTAEiru-6Jpb7fDM1Y0w@mail.gmail.com>
In-Reply-To
<20160914235843.nacr54ekvl6rjipk@sigill.intra.peff.net>
On Wed, Sep 14, 2016 at 4:58 PM, Jeff King <peff@peff.net> wrote:
Show 29 quoted lines
> There's a fancy new compression algorithm called "zstd". The
> idea is that it's supposed to get similar compression ratios
> to zlib, but with much faster compression and decompression
> times. And on top of that, a nice sliding scale to trade off
> size versus time on the compression side.
>
> The zstd site at https://facebook.github.io/zstd/ claims
> close to 3x speedup for both compression and decompression
> versus zlib, with similar compression ratios. There are
> other fast algorithms (like lz4), but they usually compress
> much worse (follow the link above for a nice table of
> results).
>
> Since any git operations that have to access objects need to
> do a zlib inflate, in theory we can speed up everything by
> using zstd. And then on the packing side, use higher
> compression levels when making on-disk packfiles (which will
> be accessed many times) and lower ones when making loose
> objects, or deflating packed objects on the fly when serving
> fetches.
>
> The catch, of course, is that it's a new incompatible
> format. This would be a pretty huge change and totally break
> backwards compatibility for git, not just on disk but
> on-the-wire as well. So my goal here was not a finished
> product but just a quick experiment to see if it did indeed
> bring the promise speedups.
>
> Disappointingly, the answer seems to be "no".

After having looked at the data, I disagree with the conclusion. And for that I think we need to reason about the frequency of the operations happening.

* As an enduser, happily hacking away at one repository,
  I probably do not care about the pack size on disk as much
  as I care about timing of the local operations. And I assume
  that for each repack we have about 1000 reads (log/rev-list)
  The 1000 is a wild speculation without any data to back it up.
  So as an end user I'd be happy about [zstd, ~5]
  For the end user LZ4 seems to be the best solution if it were available.
* As a service provider, I know we have a lot more reads than
  writes, and repacking is annoying. Also at that scale the disk
  isn't negligible cheap. So we need to weigh the numbers differently,
  but how? I suspect depending on the weighting it could still be
  considered beneficial to go with zstd5. (No hard numbers here)
Previous: Jeff KingNext: Jeff King
Message 6 of 8 in “Journal of Failed Git Experiments, Volume 1”
  1. Jeff KingSep 14, 2016
  2. 1/2 obj_hash: convert to a critbit treeJeff King, Sep 14, 2016
  3. Stefan BellerSep 15, 2016
  4. Jeff KingSep 15, 2016
  5. 2/2 use zstd zlib wrapperJeff King, Sep 14, 2016
  6. Stefan BellerSep 15, 2016
  7. Jeff KingSep 15, 2016
  8. Johannes SchindelinSep 25, 2016

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.