Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How to traverse an array as fast as possible?

by ciderpunx (Vicar)
on Jun 17, 2009 at 07:29 UTC ( [id://772264]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use warnings;
    ...
                          my $value=$array[$i];
                        }},
    });
    
  2. or download this
    $ perl a.pl
    Benchmark: timing 100 iterations of for_each, for_loop, while_pop, whi
    +le_shift...
    ...
      for_loop:  7 wallclock secs ( 7.36 usr +  0.01 sys =  7.37 CPU) @ 13
    +.57/s (n=100)
     while_pop:  5 wallclock secs ( 5.35 usr +  0.00 sys =  5.35 CPU) @ 18
    +.69/s (n=100)
    while_shift:  5 wallclock secs ( 5.38 usr +  0.00 sys =  5.38 CPU) @ 1
    +8.59/s (n=100)
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2024-04-23 13:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found