List-Helpers-XS
view release on metacpan or search on metacpan
shuffle_multi
Shuffles multiple arrays. Each array must be passed as array reference.
All undefined arrays will be skipped. This method will allow you to save
some time by getting rid of extra calls. You can pass so many arguments
as Perl stack allows.
Benchmarks
Benchmarks of "random_slice" method in comparison with
"List::MoreUtils::samples" and "List::Util::sample" showed that current
version of "random_slice" is very similar to the first ones in some
cases. But in case of huge amount of iterations it starts to slow down
due to some performance degradation.
So, the usage of "List::MoreUtils::samples" (it's the fastest now) and
"List::Util::sample" is more preferable. I'll keep "random_slice" for
backward compatibility.
The benchmark results for "shuffle" method
shuffle_huge_array List::Helpers::XS::shuffle
shuffle_huge_array -- -5%
Shuffles multiple arrays.
Each array must be passed as array reference.
All undefined arrays will be skipped.
This method will allow you to save some time by getting rid of extra calls.
You can pass so many arguments as Perl stack allows.
### Benchmarks
Benchmarks of "random_slice" method in comparison with
"List::MoreUtils::samples" and "List::Util::sample" showed that current
version of "random_slice" is very similar to the first ones in some
cases. But in case of huge amount of iterations it starts to slow down
due to some performance degradation.
So, the usage of "List::MoreUtils::samples" (it's the fastest now) and
"List::Util::sample" is more preferable. I'll keep "random_slice" for
backward compatibility.
The benchmark results for "shuffle"
```
shuffle_huge_array List::Helpers::XS::shuffle
lib/List/Helpers/XS.pm view on Meta::CPAN
Shuffles multiple arrays.
Each array must be passed as array reference.
All undefined arrays will be skipped.
This method will allow you to save some time by getting rid of extra calls.
You can pass so many arguments as Perl stack allows.
=head1 Benchmarks
Benchmarks of C<random_slice> method in comparison with C<List::MoreUtils::samples> and
C<List::Util::sample> showed that current version of C<random_slice> is very similar to
the first ones in some cases. But in case of huge amount of iterations it starts to slow
down due to some performance degradation.
So, the usage of C<List::MoreUtils::samples> (it's the fastest now) and C<List::Util::sample> is more preferable.
I'll keep C<random_slice> for backward compatibility.
The benchmark results for C<shuffle> method
shuffle_huge_array List::Helpers::XS::shuffle
shuffle_huge_array -- -5%
List::Helpers::XS::shuffle 5% --
( run in 0.593 second using v1.01-cache-2.11-cpan-71847e10f99 )