This PR adds another compression method, which is very similar to Chimp, but can decompress in a fraction of the time that Chimp takes to decompress (from 5x slower to 2x slower than uncompressed).
Chimp stores 2 flag bits to indicate the compression used, Patas takes one of those methods with a slight variation.
Optimizing for highest trailing zeros
They both make use of a very clever way of maximizing the trailing zeros (which is taken directly from the Chimp128 paper), by using the least significant bits of the number to index into an array that stores the index into a circular buffer (with a size of 128).
Using this we can find the value that shares the least significant bits with the value we're currently compressing.
Because these bits are identical, the XOR result will turn all those bits into 0s.
The reference index is the difference between our current index and that of the previous value (always between 0-127).
Chimp
Chimp checks the amount of trailing zeros in the XOR result, and if it exceeds a certain threshold, it compresses in this manner:
Combine the reference index (7 bits), the leading zeros (3 bits) and the amount of significant bits (6 bits) into a single 2-byte integer.
Then store the significant bits.
Patas
What Patas does is similar:
Combine the reference index (7 bits), the amount of significant bytes (3 bits), and the trailing zeros (6 bits) into a single 2-byte integer.
Then store the significant bytes.
By writing the significant bits in a byte-aligned way, reading is much faster because we will never have to deal with any bit-level offsets.
Also because every value will have this "packed" data of 16 bits, there are no separate indices for every array of data we might need, which is the case in Chimp.