Skip to content

Commit 8809328

Browse files
derrickstoleegitster
authored andcommitted
Documentation: changed-path Bloom filters use byte words
In Documentation/technical/commit-graph-format.txt, the definition of the BIDX chunk specifies the length is a number of 8-byte words. During development we discovered that using 8-byte words in the Murmur3 hash algorithm causes issues with big-endian versus little- endian machines. Thus, the hash algorithm was adapted to work on a byte-by-byte basis. However, this caused a change in the definition of a "word" in bloom.h. Now, a "word" is a single byte, which allows filters to be as small as two bytes. These length-two filters are demonstrated in t0095-bloom.sh, and a larger filter of length 25 is demonstrated as well. The original point of using 8-byte words was for alignment reasons. It also presented opportunities for extremely sparse Bloom filters when there were a small number of changes at a commit, creating a very low false-positive rate. However, modifying the format at this point is unlikely to be a valuable exercise. Also, this use of single-byte granularity does present opportunities to save space. It is unclear if 8-byte alignment of the filters would present any meaningful performance benefits. Modify the format document to reflect reality. Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 891c17c commit 8809328

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Documentation/technical/commit-graph-format.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ CHUNK DATA:
9797
bit on. The other bits correspond to the position of the last parent.
9898

9999
Bloom Filter Index (ID: {'B', 'I', 'D', 'X'}) (N * 4 bytes) [Optional]
100-
* The ith entry, BIDX[i], stores the number of 8-byte word blocks in all
101-
Bloom filters from commit 0 to commit i (inclusive) in lexicographic
102-
order. The Bloom filter for the i-th commit spans from BIDX[i-1] to
103-
BIDX[i] (plus header length), where BIDX[-1] is 0.
100+
* The ith entry, BIDX[i], stores the number of bytes in all Bloom filters
101+
from commit 0 to commit i (inclusive) in lexicographic order. The Bloom
102+
filter for the i-th commit spans from BIDX[i-1] to BIDX[i] (plus header
103+
length), where BIDX[-1] is 0.
104104
* The BIDX chunk is ignored if the BDAT chunk is not present.
105105

106106
Bloom Filter Data (ID: {'B', 'D', 'A', 'T'}) [Optional]

0 commit comments

Comments
 (0)