On 08/23/2012 02:54 AM, Salvador Fandino wrote:


It's a pity Sort::Maker not in Debian

There is also Sort::Key, available in Debian testing and unstable, and
which is usually faster than Sort::Maker and also Sort::Key::Radix, even
faster when sorting by numeric keys but not available in Debian.

   use Sort::Key qw(ukeysort);

   my @sorted = ukeysort { /^(\d+)-(\d+)/
                             or die "bad key $_";
                           $1 * 100 + $2 } @data;


The 'u' prefix in 'ukeysort' specifies that the sorting key is an
unsigned integer.

you are comparing apples and oranges. your module provides numerous specialized sort subs (like php does) which means the coder has to remember or lookup what each one does. i counted at least 32 similarly names subs which is very confusing. having a single sub with a flexible api is a much better interface.

your claim for it being faster needs backing with benchmarks with multiple keys. single key sorts are fast with just the sort function as is. since your multikey sorts must use a map/sort/map method, again showing how they are faster then the GRT would be interesting.

uri



--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to