Bucket occupancy under three hashes, 192 keys in 256 buckets
Bucket occupancy under three hashes, 192 keys in 256 buckets
Each strip is the first 64 buckets, drawn as a column per bucket in proportion to how many keys landed in it, with the treeify threshold of 8 marked. a well-spread hash: longest bucket 4, worst lookup 4 chained and 4 treed · the low bits only: longest bucket 31, worst lookup 31 chained and 5 treed · every key collides: longest bucket 192, worst lookup 192 chained and 8 treed. The threshold is chosen so that under a hash worth using it never fires — the JDK's own comment puts the chance of a bucket reaching eight at about 6 × 10⁻⁸ — which makes it a mechanism whose entire value is in the case its author did not control.
Drawn at 700 × 278, wide on the page.
Everything above is what bucket-occupancy returns with no arguments; the caption is the
generator's own, computed from the numbers in the drawing rather than written beside it.
2 essays call
bucket-occupancy. The drawing above is what it returns with no arguments at all; every
call below passes it something, because a placement that passes nothing draws whichever
member of the family the generator happens to default to rather than the one its essay
argues about — which is what optcheck and figfill exist to catch.
Where it is called
Changing this generator changes every one of these figures.