3 ms·
It does matter for performance. If you read files in the same order they are on disk (often, the order in which they were written, which readdir on modern file
by o11c 2y ago
It does matter for performance.
If you read files in the same order they are on disk (often, the order in which they were written, which readdir on modern filesystems should choose to produce), I/O is much faster.
- scrapheap 2y agoIt's worth noticing that the performance difference between sequential and non-sequential reads will differ significantly between types of devices. It's much more noticeable on a spinning hard disk drive than it is on a solid-state drive.
- bitwize 2y agoOn spinning rust, sure. That does not hold for SSDs (which most consumer-grade computers have now).
- jbverschoor 2y agoYou’d still miss out on some potential prefetch cache misses
- LoganDark 2y agoLiterally condemn any computer that still comes new from the factory with spinning rust. I was using SSDs back in 2012.
- eptcyka 2y agoOrder of files listed in a directory need not match the order of the bytes saved in the physical media.