Just remember, wait till the realization is finished, then write.
The test shows that the compression ratio is related to the data characteristics
Some can reach 170, others can only reach 18
In any case, meet the development requirements
Page out
The integers are grouped according to 65536, each group is called a page, and the compression processing is done on this page;
Benefit: The 4-byte integer becomes all 2 bytes short.
Multi-bit streaming
Block each page again by a certain length
Base: The cardinality of this block
Bits: The bit stream of integers within this block, 1 means that the corresponding integer exists, and 0 means that there is no
Each fixed number of bits in the gate:bits is recorded as a unit, the bit of this unit is all 0, then the corresponding single bit in gate is 0, otherwise 1
bits compression: Delete all 0 units;
Merge buffers
Finally, the above three types of data are encoded into their respective memory, and then eventually merged into the corresponding memory of this page, and then re-merge the memory of multiple pages;
A compression algorithm for different positive integers: paged multi-bit stream