- array statistics arrayName
AMG: For ideal performance, each bucket would have zero or one entries in it. This yields constant-time lookups. Performance degrades to linear (like with [lsearch] without -sorted) as more entries are placed in each bucket.To counteract this effect, Tcl arrays (and dicts) have a maximum loading factor of three elements (average) per bucket. When this load factor is exceeded, the array is reallocated to have four times as many buckets as before.Computation of hash keys for array lookup is linear with respect to key length (in bytes, not characters). However, keys tend to have similar lengths, so it's a reasonable simplification to treat hash key computation as taking constant time.