“But this was after randomly selecting a zero-sized list, using a CPU-expensive random number generator.”
A Netflix service lost 38% of its CPU to ZFS. The team wasn’t using ZFS. Every ARC counter read zero. A “performance feature” picked a random cache list to evict from, and burned the CPU generating random numbers to empty a cache that held nothing. Optimizations nobody measured are just bugs with good intentions.