简体   繁体   中英

Reading Large Binary Files in C++ (Windows)

I have a problem with reading large files in windows. Normally, in linux when I read the binary file for the first time it took 3-4 minutes to read the file but in next runs, it reads the file in less than 30 seconds because the file is in the memory and it is not required to read the whole file but in windows, everytime it takes 3-4 minutes as it always tries to read the whole file.

Anyone knows any methods to cache the file in the memory in the windows to decrease the reading time?

Thank you very much

The fastest way to read a large binary file on most systems is to use a memory mapped file. The source file serves as its own page file.

See

  CreateFileMapping

on Windoze.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM