Reputation: 8354
I am using the Windows API to work with files. My performance is very good. I read file in chunks but i don't know the optimum size of it. I know it should be a multiple of the cluster size of the disk.
Does the disk has a cache? IF i use a chunk larger than the cache my performance should worst? Am I correct?
thanks!
Upvotes: 2
Views: 172
Reputation: 1133
Yes, Windows is providing a cache layer when working with files. See official MS documentation. I'm not sure about the exact cache size and possible tradeoffs, good chance the cache size depends on the system's available memory size and maybe other factors.
Another good way to improve performance is to use the asynchronous I/O API. It's harder to write and maintain, but improves your performance. See official example.
Upvotes: 1