Two operations:
- read 1 byte from disk
- read 1000 bytes from disk
Why exactly will they have approximately the same speed?
Two operations:
Why exactly will they have approximately the same speed?
A computer have different "layers" of memory. Each layer is faster and lighter than the previous one. When the processor ask for a block of memory, he takes a look at the first layer (very fast in therm of reading speed but very small as well). If the needed block here, the processor read it. If not, the 1st layer look at the 2nd layer and load the block if it's present, the processor read the block from the 1st layer. If not, the 2nd layer look at the 3rd etc...
This is why there is almost no difference between read a byte and several at the same time, because the processor reads memory in block of byte, not in byte. However, if the processor ask for two datas coming from a different block, the require time will be different. (depending on the last commun block of those two datas)