Class TextHashFunctions

java.lang.Object
org.eclipse.jgit.pgm.TextBuiltin
org.eclipse.jgit.pgm.debug.TextHashFunctions

class TextHashFunctions extends TextBuiltin
Scan repository to compute maximum number of collisions for hash functions. This is a test suite to help benchmark the collision rate of hash functions when applied to file contents in a Git repository. The test scans all text files in the HEAD revision of the repository it is run within. For each file it finds the unique lines, and then inserts those lines into a hash table to determine collision rates under the selected hash functions. To add another hash function to the test suite, declare a new instance member field of type TextHashFunctions.Hash and implement the hashRegion method. The test suite will automatically pick up the new function through reflection. To add another folding function (method of squashing a 32 bit hash code into the hash tables smaller array index space), declare a new instance field of type TextHashFunctions.Fold and implement the logic. The test suite will automatically pick up the new function through reflection.