roaringBitMap

关于roaringBitMap的个人理解
Using n bits, we can represent any set made of the integers from the range[0,n),
it suffices to set the ith bit to one if integer i is in the set.W = 32 or W = 64.


By combining many such words, we can support large values of n Intersections,unions and defferences 
can then be implemented . When the bitset approach is applicable, it can be orders of magnitude faster than other possibel 
implementation of a set(eg as a hash set)while using  several times less memory.


For better performance, chambi proposed the Roaring bitmap format ,and made it avaulable as an open-source library .Roaring partitions 
the space [0,n) into chunks of 2^16 integers ([0,2^16),[2^16,2*2^16),[3*2^16,4*2^16),...).Each set value is stored in a container corresponding 


to its chunk. Roaring stores dense and sparse chunks chunks defferently. Dense chunks(more than 4096 intgers) are stored using convertional 


bitmap containers(made of 2^16 bits or 8KB) whereas sparse chunks use smaller containers made of packed sorted arrays of 16-bit integers.All 


integers in a chunk share the same 16 most-significant bits. The containers are stored in an array along with the most-significant bits.Though we 


refer to a Roaring bitmap as a bitmap,it is a hybrid data structure,combining uncompressed bitmap  with sorted arrays.


Roaring allows fast random access . To check for the presence of a 32-bit integer x, we seek the container corresponding to the 16 most 


significant bit of x,using a binary search. If a bitmap container is found ,we check the corresponding bit (at index x mod 2^16); if an array
container is found,we user a binary search. Similarly, we can compute the intersection between two Roaring bitmaps without having to access all 


of the data.

你可能感兴趣的:(roaringBitMap)