git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Pack v4 again..
@ 2015-02-13 10:46 Duy Nguyen
  2015-02-16  4:59 ` Nicolas Pitre
  0 siblings, 1 reply; 7+ messages in thread
From: Duy Nguyen @ 2015-02-13 10:46 UTC (permalink / raw)
  To: Nicolas Pitre; +Cc: Git Mailing List

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-02-17  4:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-13 10:46 Pack v4 again Duy Nguyen
2015-02-16  4:59 ` Nicolas Pitre
2015-02-16  6:45   ` Jeff King
2015-02-16  7:12     ` Junio C Hamano
2015-02-16 10:48     ` Duy Nguyen
2015-02-17  4:12     ` Shawn Pearce
2015-02-16 10:11   ` Duy Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).