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

Pack v4 again..

From
Duy Nguyen <pclouds@gmail.com>
Date
Feb 13, 2015, 10:46 UTC
Message-ID
<CACsJy8CMCTirggRhD28xvv4tM8b4+NL_ruF4LgW293dHAmLYdA@mail.gmail.com>

After taking 1.5 years "vacation" from pack v4, I plan to do something about it again. Will post more when I have some patches to discuss. Only one question for now (forgive me if I asked already, it's been quite some time)

I think pack v4 does not deliver its best promise that walking a tree is simply following pointers and jumping from place to place. When we want to copy from the middle of another tree, we need to scan from the beginning of the tree. Tree offset cache helps, but the problem remains. What do you think about an alternative format that each "copy" instruction includes both index of the tree entry to copy from (i.e. what we store now) _and_ the byte offset from the beginning of the tree? With this byte offset, we know exactly where to start copying without scanning from the beginning. It will be a bit(?) bigger, but it's also faster.

I imagine this is an optimization that can be done locally. The pack transferred over network does not have these byte offsets. After the pack is stored and verified by index-pack, we can rewrite it and add this info. The simplest way is use a fixed size for this offset (e.g. uint16_t or even uint8_t), add the place holder in copy instructions of all v4 trees. After that object offsets will not change again and we can start filling real offsets to placeholders.

PS. The rebased version on recent master is here if anyone is interested
https://github.com/pclouds/git/commits/pack-v4
-- 
Duy
Next: Nicolas Pitre
Message 1 of 7 in “Pack v4 again..”
  1. Duy NguyenFeb 13, 2015
  2. Nicolas PitreFeb 16, 2015
  3. Jeff KingFeb 16, 2015
  4. Junio C HamanoFeb 16, 2015
  5. Duy NguyenFeb 16, 2015
  6. Shawn PearceFeb 17, 2015
  7. Duy NguyenFeb 16, 2015

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.