Skip to main content

INDEX_BYTES_PER_RECORD

Constant INDEX_BYTES_PER_RECORD 

Source
const INDEX_BYTES_PER_RECORD: usize = _; // 21usize
Expand description

Bytes the index of one record costs, as a rule of thumb rather than a hard bound: the hash table of the [IndexMap] keeps one usize and one control byte per bucket, its bucket count is a power of two and it is never more than 7/8 full, which is up to about 2.3 buckets per record just after it doubled. Under churn, hashbrown resizes instead of rehashing in place when a table full of deleted-record tombstones holds more than half its capacity, which can double the index once more. That was not seen in the measured churn (a million records, evictions and removals), where the resident memory stayed within the accounted figure thanks to the other conservative terms of record_bytes (the growth spare, and the figure being the worst case at a full shard).