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
The Huffman encoding in both flate and bzip2 is identical except for some minor differences:
bzip2 treats the leading bits in a bitstream as the MSB of a byte, while flate treats the leading bits as the LSB of a byte.
bzip2 allows Huffman codes to be up to 20-bits long, while flate allows codes up to 15-bits long.
Currently, the implementation of Huffman encoding in flate is superior (and faster) to the one in bzip2. The differences are very minor and it should be able to unify the two without any performance hit. We should extract the common logic as compress/internal/huffman.
The text was updated successfully, but these errors were encountered:
Looks like an interesting performance optimization and stdlib simplification. Any plans to work on this personally or is it open for the community in general?
The Huffman encoding in both
flate
andbzip2
is identical except for some minor differences:bzip2
treats the leading bits in a bitstream as the MSB of a byte, whileflate
treats the leading bits as the LSB of a byte.bzip2
allows Huffman codes to be up to 20-bits long, whileflate
allows codes up to 15-bits long.Currently, the implementation of Huffman encoding in
flate
is superior (and faster) to the one inbzip2
. The differences are very minor and it should be able to unify the two without any performance hit. We should extract the common logic ascompress/internal/huffman
.The text was updated successfully, but these errors were encountered: