4 ms·
>> but reading files in parallel would presumably be slower since you'd be jumping around on disk There is a lot of engineering that goes into making parallel
by Derander 14y ago
>> but reading files in parallel would presumably be slower since you'd be jumping around on disk
There is a lot of engineering that goes into making parallel reads go fast. Some combination of the file system and disk controller will probably be smart enough to recognize the opportunity for sequential reads and execute them as such if possible.
This is not always true, and it does not undermine the rest of what you have written. I just think it's interesting to keep in mind that operating systems implement a lot of helpful machinery that user-level programmers forgot about.
- justincormack 14y agoStat just reads metadata that is (hopefully) cached in memory. Linux does not have any async APIs for reading metadata anyway. Examples are always a bit contrived, it doesn't matter.