PB wrote:Not bad gnozal, that gives me about 200ms faster than PureBasic's version.
But that's still not an amazing difference. I wonder if my memory is wrong?
I'm sure I used something that was blisteringly fast, because I distinctly
remember wondering why PureBasic didn't use that code instead. Dunno.
How are you testing that? Keep in mind that file system access is cached by the OS, so after you run the test once, further runs may be faster just because the data is already available. If you have lots of free ram, the entire file could have been cached.
Anyway, i don't think you can get any faster than a file mapping.
PB wrote:(Oh, and in the code you gave, FileLength should be a quad, for big files).
That won't make a difference. MapViewOfFile_() can only map chunks that fit into your program's address space. So you are limited to something under 2GB anyway in a 32bit program. If you want to work with larger files, you have to map them in several parts (or create a 64bit application).