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

Re: Understanding version 4 packs

From
MCMarco Costalba <mcostalba@gmail.com>
Date
Mar 26, 2007, 12:16 UTC
Message-ID
<e5bfff550703260516q5da5f46et8aab2ebadcd9cceb@mail.gmail.com>
In-Reply-To
<20070325091806.GH25863@spearce.org>
On 3/25/07, Shawn O. Pearce <spearce@spearce.org> wrote:
Show 18 quoted lines
> Peter Eriksen <s022018@student.dtu.dk> wrote:
> > On Sat, Mar 24, 2007 at 07:24:17PM -0400, Nicolas Pitre wrote:
> > > On Sat, 24 Mar 2007, Peter Eriksen wrote:
> > >
> >
> > The uncompressed file name table contains NR_ENTRIES entries,
> > and looks like this:
> >
> > +------------+------+--------------+------+--------------------+----
> > | NR_ENTRIES | MODE |  Full path 1 | MODE | Full path 2        | ...
> > +------------+------+--------------+------+--------------------+----
> >    4 bytes    2 bytes   n1 bytes    2 bytes     n2 bytes
> >
> > MODE is a network-byte-order integer representing the mode of the path,
> > and the path is a variable length, null-terminated string.
>
> Yes so far.
>

Perhaps has been already evaluated and my comment is not pertinent but, anyway...

Experimenting with file names cache in qgit I have found a big saving splitting the paths in base name and file name and indexing both:

drivers\usb\host\ehci.h drivers\usb\host\ehci-pci.c drivers\usb\host\ohci-pci.c kernel\sched.c

became:
dir names table

0 drivers\usb\host 1 kernel

file name table

0 ehci.h 1 ehci-pci.c 2 ohci-pci.c

In this way a big saving is achieved in case of directories deep in the tree (long paths) and a lot of files. Also after compressing the difference is noticeable.

Regarding MODE field an observation could be that is almost always the same, so an idea could be to store a 'default mode' just after nr_entries and do not add the field any more except in case path mode is different from default mode. In case this could bring to unaligned entries another idea could be to store _all_ mode fields at the beginning (or at the end and let deflate to remove almost everything more easily)

  Marco
Previous: Nicolas PitreNext: Nicolas Pitre
Message 11 of 19 in “Understanding version 4 packs”
  1. Peter EriksenMar 24, 2007
  2. Nicolas PitreMar 24, 2007
  3. Peter EriksenMar 25, 2007
  4. Shawn O. PearceMar 25, 2007
  5. Linus TorvaldsMar 25, 2007
  6. Shawn O. PearceMar 25, 2007
  7. Nicolas PitreMar 26, 2007
  8. Shawn O. PearceMar 26, 2007
  9. Jakub NarebskiMar 26, 2007
  10. Nicolas PitreMar 26, 2007
  11. Marco CostalbaMar 26, 2007
  12. Nicolas PitreMar 26, 2007
  13. Marco CostalbaMar 26, 2007
  14. Nicolas PitreMar 26, 2007
  15. Nicolas PitreMar 26, 2007
  16. Marco CostalbaMar 27, 2007
  17. Shawn O. PearceMar 27, 2007
  18. Shawn O. PearceMar 25, 2007
  19. Shawn O. PearceMar 25, 2007

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.