Optimal Buffer size for read-process-write

后端 未结 6 1835
你的背包
你的背包 2020-12-30 05:51

In my function, I need to read some data from a file into a buffer, manipulate the data and write it back to another file. The file is of unknown size and may be very large.

6条回答
  •  旧时难觅i
    2020-12-30 06:25

    I will suggest you to use buffer size of page size. For example is page size is 4K then you can use 4K Byte buffer size to minimize context switches.

提交回复
热议问题