From: Stephen Waits Date: 2005-12-08T01:28:53+09:00 Subject: Re: Shuffling an array, sort_by{rand}'s bias (was Re: need some Ruby magic) On Dec 7, 2005, at 6:57 AM, hmassa@gmail.com wrote: > Why not > a.dup.sort { 2*rand(12345) <=> 12345 } Because it's the slowest version I've tested. See the rest of the thread for my benchmarks. In order of speed, we have 'shuffle3', 'sort_by {rand}', and 'shuffle4'. --Steve