This is what I wanted to point out: in the end the harddisk is limiting factor, the CPU is mostly idling, so the code is largely irrelevant, unless it's extremely inefficient.
Yeah, I was just gonna say that. File ops aren't really that important to optimize. If they work, they are almost always faster than the hard drive unless you completely f*ck up. However it would be interesting if anyone with a fast SSD would do some benchmarks.
You're making the classic mistake in file performance benchmarking: you forget that the OS will cache any file that was recently read.
For a realistic benchmark, overwrite the file prior to each time you read the file.
In the above benchmark, that means overwriting the file 300 times, otherwise your results are useless.
I think you're wrong here. By eliminating the hard drive from the benchmark, aren't you getting more accurate results? We're benchmarking CPU performance, right? Do the different read methods actually affect the way a hard drive reads files to the point that performance differs noticeably?