Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^7: Benchmark, -s versus schwartzianby ambrus (Abbot) |
on Aug 23, 2004 at 19:41 UTC ( [id://385196]=note: print w/replies, xml ) | Need Help?? |
If sort {$a<=>$b} is indeed optimized (it seems so), you can just use it for a floating-point key, you just have to 'no warnings "numeric"; and put the float in the first place. You are, however, right in that if the key is more complicated, this method is not applicable. (You can however gain with the ST only if calculating the key is much slower than comparing them.)
In Section
Seekers of Perl Wisdom
|
|