Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
2 changed files
with
40 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters