Hi,

i'm planning to sort an input file (which was File::Slurp'ed, most likely 
megabyte-sized file) in various ways. I did some readings and learned several 
methods
that people have come up with in recent years. So to summarize, the default 
sort is fast (uses quick sort), explicit (using sub) is a bit slower, other 
method
that uses caching is faster. Then there's Schwartzian Transform and a packed 
version by Guttman. Seems like everything is clear. Guttman is the fastest,
until I went to cpan. Found Sort::Key, which claims to be the fastest, even 
faster that ST, GRT. Now, before someone says, why not try each one and
see for yourself (which doing such could be another subject for me to learn), 
my question is this: if such faster sorting algorithms exist, why don't they 
just replace the default sort function in Perl?

And for the classical question, given my situation (in combination with 
File::Slurp), which is fastest sort method? (I hope somebody includes this in 
perlfaq in the future).


      

-- 
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