On a HDD, let's say a file is ordered on disk in blocks 1,2,3,1000,4,1001,5,6,7.
Then reading the 4th, 5th, 6th and 7th block will have larger latency than reading the 2nd, 3rd, 8th, 9th blocks because the drive heads have to move a larger distance back and forth.
What I've found puzzling and still don't quite understand is why files on an SSD exhibit some (less, but observable) of this same behavior. There's no drive head to seek, so why does it take longer?
I've noticed this when trying to read files quickly from disk. On a HDD it is clearly faster to read blocks 1,2,3,4,5,6,7,1000,1001 and reorder then in RAM instead of having the drive head seek back and forth. But why is it also quicker to read them that way off an SSD?
I another effect (besides prefetching which was just mentioned, and likely many others) is that SSDs stripe data across multiple chips for parallel sequential access, but you might end up negating some of the benefit of that if you end up accessing the same chip.
I would hazard a guess and say prefetching. SSDs have large blocks, so when you read 1, blocks 2-5 are maybe part of the block and loaded in anyway. Then the controller might also cache 6-10 for the heck of it. And 1000+ isn't, so it's not in cache, so it's slower.
You might want to try a skipping read test, ie, reading sector 1, sector +10MB, sector +1GB, etc until end of disk, to avoid the controller or OS being able to prefetch data into cache.
Then reading the 4th, 5th, 6th and 7th block will have larger latency than reading the 2nd, 3rd, 8th, 9th blocks because the drive heads have to move a larger distance back and forth.
What I've found puzzling and still don't quite understand is why files on an SSD exhibit some (less, but observable) of this same behavior. There's no drive head to seek, so why does it take longer?
I've noticed this when trying to read files quickly from disk. On a HDD it is clearly faster to read blocks 1,2,3,4,5,6,7,1000,1001 and reorder then in RAM instead of having the drive head seek back and forth. But why is it also quicker to read them that way off an SSD?