Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

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

by steve (Deacon)
on Jan 15, 2010 at 16:24 UTC ( [id://817660]=note: print w/replies, xml ) Need Help??


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

In addition to what others have said, some additional (external) factors may also contribute to the results you see, for example:
  1. Disk I/O: different filesystems read in different ways and scheduled I/O can be affected by that as well as block size (see tuning information for "elevator" algorithm on ext3).
  2. CPU allocation: other processes can be competing for the same CPU.
  3. Available RAM: loading an entire file into RAM is much quicker than loading a segment of it into virtual memory or a paging file.
  • Comment on Re: 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://817660]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (2)
As of 2024-04-20 04:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found