views:

20

answers:

1

Or it would be faster to re-read that data from mapped memory once again, since the OS might implement its own cache?

The nature of data is not known in advance, it is assumed that file reads are random.

+1  A: 

The answer is highly OS-specific. Generally speaking, there will be no sense in caching this data. Both the "cached" data as well as the memory-mapped can be paged away at any time.

If there will be any difference it will be specific to an OS - unless you need that granularity, there is no sense in caching the data.

Yuval A