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

Re: GSoC - Designing a faster index format

From
ESelton sky <eltonsky9404@gmail.com>
Date
Mar 26, 2012, 12:41 UTC
Message-ID
<CAKTdtZnsiP9VO2Us6dF760SFnEbpVgsAhcuOjOxuzBZxDODizQ@mail.gmail.com>
In-Reply-To
<CAKTdtZkx+7iU5T4oBNDEx-A5cgZCLU9ocdXmC9jRbD39J1zb3Q@mail.gmail.com>
As the previous email is hidden in the trimmed area, just resend it:
About the new format:

The index is a single file. Entries in the index still stored sequentially as old format. The difference is they are grouped into blocks. A block contains many entries and they are ordered by names. Blocks are also ordered by the name of the first entry. Each block contains a sha1 for entries in it. For using a binary search to locate the block for an entry, the offsets of blocks are stored in the header of the index. We reserve 100 spaces for block offsets in the header. More offsets are stored in a meta block (see below) afterwards. An offset of the first meta block is stored. The checksum is computed on block. After we locate the block, the checksum is recomputed for the block. And only the this block will be read and write back later. As the block is read into ram, it is easy to do a binary search for entries in a block when they are in ram. When the index doesn't have many entries, it works very similar with current format. When more entries git-added, blocks will come into play.

Format:
Head:
- 4-byte signature
- 4-byte version num
- 4-byte num of entries blocks
- 4-byte offset for new block
- list of offsets for blocks (e.g. 96, 14096, 8192, ..) : For binary
search. Each offset is 8 bytes, we reserve 100 x 4 = 400 bytes for
first 100 blocks. More offsets (if applicable) will be stored in a
meta blocks.
- 4-byte offset to the first meta block
- 20-byte sha1 for above and meta blocks
List of Blocks:
- sha1 for all entries
- list of entries
Meta block:
- offset to next meta block
- list of offsets
Extensions:
      TBD. Have not hacked cache tree yet. Need more knowledge of cache tree...
Block Split & Delete:
      TBD.

Regards, Elton

Previous: elton skyNext: Thomas Rast
Message 12 of 33 in “GSoC - Designing a faster index format”
  1. elton skyMar 20, 2012
  2. Nguyen Thai Ngoc DuyMar 21, 2012
  3. Thomas RastMar 21, 2012
  4. elton skyMar 21, 2012
  5. elton skyMar 22, 2012
  6. Jakub NarebskiMar 23, 2012
  7. Nguyen Thai Ngoc DuyMar 23, 2012
  8. elton skyMar 23, 2012
  9. Nguyen Thai Ngoc DuyMar 23, 2012
  10. Nguyen Thai Ngoc DuyMar 24, 2012
  11. elton skyMar 26, 2012
  12. elton skyMar 26, 2012
  13. Thomas RastMar 26, 2012
  14. Nguyen Thai Ngoc DuyMar 26, 2012
  15. Shawn PearceMar 26, 2012
  16. elton skyMar 27, 2012
  17. David BarrMar 27, 2012
  18. Nguyen Thai Ngoc DuyMar 27, 2012
  19. Jeff KingMar 29, 2012
  20. Nguyen Thai Ngoc DuyMar 27, 2012
  21. Nguyen Thai Ngoc DuyMar 26, 2012
  22. elton skyMar 27, 2012
  23. Nguyen Thai Ngoc DuyMar 27, 2012
  24. elton skyApr 2, 2012
  25. Nguyen Thai Ngoc DuyApr 2, 2012
  26. Shawn PearceApr 2, 2012
  27. Nguyen Thai Ngoc DuyApr 2, 2012
  28. elton skyApr 4, 2012
  29. Nguyen Thai Ngoc DuyApr 4, 2012
  30. elton skyApr 4, 2012
  31. elton skyApr 6, 2012
  32. elton skyApr 6, 2012
  33. elton skyApr 7, 2012

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.