How can I achieve the best file streaming performance in Vista? My goal is to read a large file (several hundred MB) over the network directly into memory.
I've allocated a memory block the same size as the file. This is also my destination buffer. I've tried ReadFile, _read, fread, ifstream::read, and boost::iostreams::mapped_file::const_data--specifying _O_SEQUENTIAL or FILE_FLAG_SEQUENTIAL_SCAN when appropriate. However, I haven't been able to match the throughput of a simple cut and paste file copy via Explorer. I routinely achieve only 50% of the performance of a file copy--profiled via Task Manager. What is Explorer doing differently, and how can I achieve the same level of performance?