Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Fastest way to sort a list of integers into 0,1,2,3,-3,-2,-1

by tybalt89 (Prior)
on Feb 05, 2019 at 16:02 UTC ( #1229416=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        array => sub {
            my @list = @input;
            @list[@input] = @input;
            Compare(\@list,\@output) or die "@list" if DO_CHECK;
        },
    
  2. or download this
                 Rate johngg  Tux pryrt choroba0 choroba choroba2 grepfirs
    +t sortfirst Eily array
    johngg     6047/s     -- -26%  -36%     -57%    -67%     -69%      -70
    +%      -73% -83%  -93%
    ...
    sortfirst 22333/s   269% 174%  136%      60%     23%      15%        9
    +%        -- -37%  -73%
    Eily      35540/s   488% 337%  275%     155%     95%      83%       74
    +%       59%   --  -57%
    array     83332/s  1278% 923%  780%     499%    358%     329%      307
    +%      273% 134%    --
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2021-10-19 17:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (77 votes). Check out past polls.

    Notices?