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:
- 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).
- CPU allocation: other processes can be competing for the same CPU.
- Available RAM: loading an entire file into RAM is much quicker than loading a segment of it into virtual memory or a paging file.