Is it possible to use threads to speed up file reading?

后端 未结 6 1092
情话喂你
情话喂你 2020-12-05 07:47

I want to read a file as fast as possible (40k lines) [Edit : the rest is obsolete].

Edit: Andres Jaan Tack suggested a solution based on one thread per file, and I

6条回答
  •  悲哀的现实
    2020-12-05 08:31

    Yes, it's a waste of time. At very best you'll end up with about the same performance. At worst, it might hurt performance from the disk seeking to different parts of the file instead of reading through it consecutively.

提交回复
热议问题