Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Why is "for" much slower than "while"?

by Xiong (Hermit)
on Jan 24, 2010 at 00:08 UTC ( [id://819261]=note: print w/replies, xml ) Need Help??


in reply to Re: Why is "for" much slower than "while"?
in thread Why is "for" much slower than "while"?

My results from gam3's script, second version:

/dev/null
                Rate        for     whyfor      while while_list   for_list
for         280029/s         --       -16%       -17%       -73%       -74%
whyfor      333697/s        19%         --        -1%       -68%       -69%
while       338448/s        21%         1%         --       -68%       -69%
while_list 1050567/s       275%       215%       210%         --        -3%
for_list   1079903/s       286%       224%       219%         3%         --
/usr/share/dict/words
             Rate        for     whyfor while_list      while   for_list
for        3.67/s         --       -39%       -41%       -42%       -51%
whyfor     5.99/s        63%         --        -4%        -5%       -21%
while_list 6.26/s        71%         5%         --        -0%       -17%
while      6.27/s        71%         5%         0%         --       -17%
for_list   7.56/s       106%        26%        21%        21%         --
/etc/passwd
              Rate     whyfor        for while_list      while   for_list
whyfor     13584/s         --       -13%       -17%       -30%       -56%
for        15664/s        15%         --        -5%       -19%       -49%
while_list 16411/s        21%         5%         --       -15%       -47%
while      19273/s        42%        23%        17%         --       -38%
for_list   30882/s       127%        97%        88%        60%         --
  • Comment on Re^2: Why is "for" much slower than "while"?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-16 04:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found