bucket_stats#
Return a rich statistical summary of the hash’s bucket layout.
Synopsis#
my ($keys, $buckets, $used, $quality, $utilization_ratio, $collision_pct, $mean, $stddev, @length_counts) = bucket_stats(%hash);
Extends bucket_info with derived quantities:
$quality is the Red-Dragon quality score (ideal 1.0, acceptable
around 0.95–1.05, worse as the number grows), $utilization_ratio
is the fraction of used buckets, $collision_pct is the fraction
of keys sharing a bucket with at least one other key, and $mean
and $stddev describe the bucket-chain-length distribution over
used buckets.
For an empty hash, only $keys, $buckets, and $used are
returned — the statistical block is skipped.