>I use "SetFilePointer()" to read different parts of a file,but I heard calling "SetFilePointer()" frequently could drop down the throughput of read operation,is it true?Should I buffered a large area of a file,and read data from that buffer?
It's "slow" because moving the current position in a file defeats caching.
It's unlikely that reading large areas of the file would be faster unless
you can predict in advance where the next read will occur.
--
Carey Gregory
Windows Print Drivers & Components
http://www.gw-tech.com
If I open a file with no catching(add FILE_FLAG_NO_BUFFERING),then how the performance of "SetFilePointer()"?
>If I open a file with no catching(add FILE_FLAG_NO_BUFFERING),then
>how the performance of "SetFilePointer()"?
It probably doesn't make much difference to SetFilePointer itself.
Disabling caching can maximize async performance with overlapped I/O, but
for *most* applications it will significantly degrade read/write
performance. It also imposes a heavy price on the application which now
has to align all I/O operations on sector size boundaries.
Writing a simple program you can experiment with to measure I/O
performance would be pretty easy. Why not do that?