Get hash

Purpose: Get usage specifics for a hash.

 get-hash  <hash > \
     ( length <length> ) \
     | ( hash-size <hash size> ) \
     | ( average-reads <reads> )

get-hash provides usage specifics of a <hash> (created by new-hash).

Use "length" clause to obtain its <length> (i.e. the number of elements stored in it), "hash-size" clause to obtain its <hash size> (i.e. the number of "buckets", or possible hash codes in the underlying hash table).

"average-reads" clause will obtain in <reads> the average number of reads (i.e. how many string comparisons are needed on average to find a key) multiplied by 100 (so if an average number of reads was 1.5, it will be 150).

This information may be useful in determining the performance of a hash, and whether resize-hash is indicated.
Examples
 get-hash h length l hash-size s average-reads r

See also
Hash
get-hash  
new-hash  
purge-hash  
read-hash  
resize-hash  
write-hash  
See all
documentation


Copyright (c) 2019-2025 Gliim LLC. All contents on this web site is "AS IS" without warranties or guarantees of any kind.