|
|
| Perl: the Markov chain saw | |
| PerlMonks |
Re: Very Large Arraysby salva (Monsignor) |
| on Feb 17, 2012 at 16:41 UTC ( #954563=note: print w/ replies, xml ) | Need Help?? |
|
Shuffling an array is one of those thinks that can be done much more efficiently in C/XS than in Perl. I have just uploaded to CPAN Array::Shuffle, that is one or two orders of magnitude faster than List::Util::shuffle or your hand-crafted shuffle implementation in Perl. It's memory usage is O(1). (List::Util::shuffle is also implemented in C, but it has the wrong interface from a performance point of view)
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||