Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: About List::Util's pure Perl shuffle()

by ikegami (Pope)
on Jul 11, 2007 at 17:47 UTC ( #626057=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub ikegami (@) {
        my @a=@_;
    ...
        my $x;
        map +( $n=rand($i--), $x=$a[$n], $a[$n]=$a[$i] )[1], @a
    }
    
  2. or download this
               Rate    naive listutil   runrig broweruk  ikegami
    naive     636/s       --      -6%     -19%     -26%     -37%
    ...
    runrig    785/s      23%      16%       --      -9%     -22%
    broweruk  859/s      35%      27%       9%       --     -15%
    ikegami  1010/s      59%      50%      29%      18%       --
    
  3. or download this
    our @data = map { 'x' x 1000 } 1..1000;
    cmpthese -3, { map { $_ => "$_ \@data" } qw/naive listutil broweruk ru
    +nrig ikegami/ };
    
  4. or download this
              Rate   runrig    naive  ikegami listutil broweruk
    runrig   118/s       --     -10%     -40%     -43%     -86%
    ...
    ikegami  197/s      68%      51%       --      -5%     -77%
    listutil 207/s      76%      58%       5%       --     -76%
    broweruk 860/s     632%     558%     336%     315%       --
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://626057]
help
Chatterbox?
Corion idly wonders about creating a series of HTTP requests. There seems to be no framework to generate a series of HTTP requests, like "try all these requests"
[Corion]: This is vaguely inspired by that list of "nasty" strings, which I'd like to replace among HTTP parameters, just to see whether the application crashes, but also for easy downloading of a list of URLs etc
[Corion]: Maybe I'll just conoct something using Algorithm::Permute to create an (OO) generator for such requests, or a simple function.
[Corion]: For testing I imagine one would want to test a random sampling of such "bad"/"unexpected" requests, while for downloading, one would want to generate them all in order, but not necessarily as a huge list

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2017-01-16 15:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (151 votes). Check out past polls.