in reply to Re^4: Unusual sorting requirements; comparing three implementations.
in thread Unusual sorting requirements; comparing three implementations.
Just for fun, I installed salva's Sort::Key and added:
sub x2 { my @sorted = keysort { $_->title =~ /Manager/ ? 'A'.$_->name : 'B'.$_->name } @employees; }
With these results:
C:\test>junk87 Rate obvious subtle functional x +x2 obvious 186/s -- -20% -61% -83% -8 +9% subtle 232/s 24% -- -51% -79% -8 +6% functional 477/s 156% 106% -- -56% -7 +2% x 1085/s 483% 368% 127% -- -3 +7% x2 1717/s 822% 641% 260% 58% +--
|
|---|