file: job.t package: muf status: alpha
makeHashedBtree function constructs and
returns a new
nullHashedBtree instance. This is
an immediate value (it takes no space beyond the
return slot itself).
All the other btree functions operate equally well on hashed or sorted btrees.
Hashed btrees can often be faster than sorted btrees, because they do all interior comparisons on hashes of keys, rather than the keys themselves: If the keys are long strings, say, comparing integer hash values can be much faster than comparing the string keys themselves.
On the other hand, hashed btrees require three values per key-val pair in the leaf, meaning that big trees may take 50% more space, and when you iterate over them, the keys will appear in an arbitrary order dictated by the hash function. If your keys are small immediate values anyhow anyhow (integers of 62 bits or less, or strings of seven bytes or less), a hashed tree won't buy you anything, and you might as well use a sorted tree.
See section makeSortedBtree.
Go to the first, previous, next, last section, table of contents.