Interleaved parallel file read slower than sequential read?

前端 未结 4 934
逝去的感伤
逝去的感伤 2021-01-17 17:25

I have implemented a small IO class, which can read from multiple and same files on different disks (e.g two hard disks containing the same file). In sequential case, both d

4条回答
  •  日久生厌
    2021-01-17 18:12

    As you said, a sequential read on a disk is much faster than a read-skip-read-skip pattern. Hard disks are capable of high bandwidth when reading sequentially, but the seek time (latency) is expensive.

    Instead of storing a copy of the file in each disk, try storing block i of the file on disk i (mod 2). This way you can read from both disks sequentially and recombine the result in memory.

提交回复
热议问题