The node you've mentioned actually uses an even faster form of the Schwartzian transform I've completely forgot about.
Thus, I've added it to my benchmark too:
sub sort_arr { my @h = map -s, @all; @results = @all[sort {$h[$a]<=>$h[$b]} 0..@h-1]; }
The results are amazing: this form is about 1.5 times as efficent than any of the other ones.
In reply to Re^5: Benchmark, -s versus schwartzian (vs hash)
by ambrus
in thread Benchmark, -s versus schwartzian
by Darby
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |