can someone help me trying to understand how a hard drive works.
I have a small binary database file for which reading performance is absolutely necessary. If I need to skip a few bytes in a file, itβs faster to use the seek () or read () function and then discard unwanted data.
If the average search time on the hard drive is 10 ms and the read speed is 300 MB / s, I calculated that it is faster to read () than seek () with a value of less than 3 MB. Truth? Is there any overhead when doing a new search that does not read an existing stream?
Which, in your opinion, is the more suitable file structure for the index.
Entry1:Value:PointerIntoToData
Entry2:Value:PointerIntoToData
Entry3:Value:PointerIntoToData
Data, Data, Data
Or
Entry1:Value:Data
Entry2:Value:Data
Entry3:Value:Data
, , . :
1. , seek(),
2. , ,
3. , seek() .
- 4 , - 8 , - 12