bucket_stats_formatted#

Return a multi-line human-readable report of bucket_stats, complete with ASCII barcharts.

Synopsis#

print bucket_stats_formatted(%hash);

The first paragraph of the report gives the summary line (key count, used buckets, total buckets, quality score translated into “Good”, “Poor”, or “Bad”), followed by utilisation and collision percentages and the chain-length mean and standard deviation. Two barcharts follow: one showing the distribution of bucket chain lengths (how costly a missed lookup is), and one showing how many keys sit at each position in their chain (how costly a found lookup is).

Useful when deciding whether to pre-size a large hash with keys(%h) = N to cut collisions.