My program reads a file, interleaving it as below:

![enter image description here](https://i.stack.imgur.com/LLBhV.png)

The file to be read is large. It is split into four parts that are then split into many blocks. My program first reads block 1 of part 1, then jumps to block 1 of part 2, and so on. Then back to the block 2 of part 1, ..., as such.

The performance drops in tests. I believe the reason is that the page cache feature of kernel doesn't work efficiently in such situations. But the file is too large to `mmap()`, and the file is located in NFS.

How do I speed up reading in such a situation? Any comments and suggestions are welcome.