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

Re: [PATCH] reduce delta head inflated size

From
Nicolas Pitre <nico@cam.org>
Date
Oct 19, 2006, 14:17 UTC
Message-ID
<Pine.LNX.4.64.0610191012090.1971@xanadu.home>
In-Reply-To
<118833cc0610190649o484afdc8lb871d4b3c5361166@mail.gmail.com>
On Thu, 19 Oct 2006, Morten Welinder wrote:
Show 10 quoted lines
> On 10/18/06, Nicolas Pitre <nico@cam.org> wrote:
> > Supposing that both the base and result sizes were both full size 64-bit
> > values, their encoding would occupy only 9.2 bytes each.  Therefore
> > inflating 64 bytes is way overkill.  Limit it to 20 bytes instead which
> > should be plenty enough for a couple years to come.
> 
> 2^63 ~ 9.2e18
> 
> Thus one signed 64-bit number can take up 1 sign + 19 digits + 1 nul.
> That's 21 bytes.

No. In this case the value is kept binary, with bits spread over consecutive bytes but with the MSB indicating continuation on the next byte.

This means 64 bits / 7 bits per byte = 9.1 bytes, hence 10. Then there are 2 of those values that makes 20 bytes.

Nicolas
Previous: Morten Welinder
Message 3 of 3 in “reduce delta head inflated size”
  1. reduce delta head inflated sizeNicolas Pitre, Oct 18, 2006
  2. Morten WelinderOct 19, 2006
  3. Nicolas PitreOct 19, 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.