ats2libraries dsats2-bitstring_maps
Libraries and tools for use with ATS2/Postiats
Brought to you by:
chemoelectric
# An implementation of immutable bitstring maps in ATS2/Postiats Licensed GPL3 or later. Immutable maps from strings of bits, such as machine integers, to key-value pairs. The implementation employs array mapped tries and might be used to implement such things as integer maps and hashless string maps. However, bitstring maps perform best when the keys are more evenly distributed, and so are suitable, in particular, for ideal hash trees, which are maps that use hashes of ‘unlimited’ length. (In practice, one may use the same hash function repeatedly, but with different seed values, and at some point guarantee termination by using the bits of the key instead of a hash.) ## References. Bagwell, Phil. Ideal hash trees. 2001. Bagwell, Phil. Fast and space efficient trie searches. 2000. ## NOTE/WARNING: Regarding POPCOUNT instructions. The implementation uses population counts (counts of the number of 1-bits in an integer) and so, if possible, one ought to enable compiler options to emit POPCOUNT instructions. Otherwise a POPCOUNT subroutine might be called or inline code used instead. If you are using GCC and building just for the machine on which you are compiling, the ‘-march=native’ option likely will suffice. On AMD64, if you want to build for a wider range of processors, you can use the ‘-mpopcnt’ option. Only quite old AMD64 processors do not have POPCOUNT instructions.