Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^5: Unusual sorting requirements; comparing three implementations.

by BrowserUk (Pope)
on Oct 24, 2012 at 18:50 UTC ( #1000687=note: print w/ replies, xml ) Need Help??


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

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong


Comment on Re^5: Unusual sorting requirements; comparing three implementations.
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000687]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2014-07-13 19:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (251 votes), past polls