]> arthur.barton.de Git - bup.git/commit
cmd/margin: add a new --predict option.
authorAvery Pennarun <apenwarr@gmail.com>
Thu, 26 Aug 2010 03:40:34 +0000 (20:40 -0700)
committerAvery Pennarun <apenwarr@gmail.com>
Thu, 26 Aug 2010 04:23:41 +0000 (21:23 -0700)
commit7bb9af29e46b0a15bd4809d2c83c0ff276c2e8b0
tree713cd7b8f939f5f47ea47ce3f9f9278fec3cec0d
parentbaa7e474bedb61a4752afe5acfe30cd365062927
cmd/margin: add a new --predict option.

When --predict is given, it tries to guess the offset in the indexfile of
each hash, based on assumption that the hashes are distributed evenly
throughout the file.  Then it prints the maximum amount by which this guess
deviates from reality.

I was hoping the results would show that the maximum deviation in a typical
midx was less than a page's worth of hashes; that would mean the toplevel
lookup table could be redundant, which means fewer pages hit in the
common case.  No such luck, unfortunately; with 1.6 million objects, my
maximum deviation was 913 hashes (about 18 kbytes, or 5 pages).

By comparison, midx files should hit about 2 pages in the common case (1
lookup table + 1 data page).  Or 3 pages if we're unlucky and the search
spans two data pages.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
cmd/margin-cmd.py
lib/bup/git.py