You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Go 1.7 is introducing a new very fast compressor that can be selected through the flate.HuffmanOnly constant.
I find the name suboptimal:
The other compressions levels are called NoCompression, BestSpeed, BestCompression, DefaultCompression. None of the cite specific algorithm names. For instance, there is no Snappy constant to select the Snappy algorithm (that is instead called through the BestSpeed constant).
If you're not aware of the inners of the gzip compressor, you cannot know what HuffmanOnly implies. The Only word can hint at the fact that only a portion of the algorithm is being run, and you could assume that this means more speed and less ratio, but it's not immediately clear. The inline help also is very technical (Disables match search and only does Huffman entropy reduction).
When I ran an informal poll between colleagues, making them read the klauspost gzip repository's README, many were worried that the modifications would alter the DEFLATE bitstream compatibility. This produced Clarify that snappy is still gzip compatible klauspost/compress#46. I worry that HuffmanOnly might raise the same concerns. Compatibility with the DEFLATE bitstream is clarified in the release notes, but not in the documentation.
My suggestion is to change the constant to a name which better describes the results achieved rather than the algorithm used. I personally like MaxSpeed, but anything would go.
The text was updated successfully, but these errors were encountered:
While HuffmanOnly does assume a person knows a little about the internals of DEFLATE, I believe it is intentional. Part of the use case for HuffmanOnly is to compress data that has already been compressed using LZ77 string matching, and the only benefit to be gained is to apply some form of entropy encoding. This detail is crucial in choosing HuffmanOnly over BestSpeed. Also, what would the difference be between MaxSpeed and BestSpeed.
Futhermore, there is some precedence for the name HuffmanOnly:
It is analogous to the Z_HUFFMAN_ONLY from the C zlib library.
It is not just the name of the algorithm, but the name of the methodology used as specified in RFC1951. In the Abstract section, it specifically mentions that DEFLATE is a combination of LZ77 and Huffman.
That said, I believe there is benefit in documenting what HuffmanOnly does and what the intended use case is for it.
dsnet
changed the title
compress/flate: rename HuffmanOnly to something else?
compress/flate: document HuffmanOnly
Jul 25, 2016
Go 1.7 is introducing a new very fast compressor that can be selected through the
flate.HuffmanOnly
constant.I find the name suboptimal:
NoCompression
,BestSpeed
,BestCompression
,DefaultCompression
. None of the cite specific algorithm names. For instance, there is noSnappy
constant to select the Snappy algorithm (that is instead called through theBestSpeed
constant).HuffmanOnly
implies. TheOnly
word can hint at the fact that only a portion of the algorithm is being run, and you could assume that this means more speed and less ratio, but it's not immediately clear. The inline help also is very technical (Disables match search and only does Huffman entropy reduction
).HuffmanOnly
might raise the same concerns. Compatibility with the DEFLATE bitstream is clarified in the release notes, but not in the documentation.My suggestion is to change the constant to a name which better describes the results achieved rather than the algorithm used. I personally like
MaxSpeed
, but anything would go.The text was updated successfully, but these errors were encountered: