Performance of fwrite and write size

后端 未结 5 1512
小蘑菇
小蘑菇 2020-12-15 12:29

I\'m writing out a large numerical 2 dimensional array to a binary file (final size ~75 MB).

I\'m doing this on a linux system. First, is there a better method or s

5条回答
  •  感情败类
    2020-12-15 12:48

    Just use fwrite (no need to go lower level syscalls) and do it as one chunk. The lower level syscalls will figure out how to buffer and split up that write command the best. I've never been able to beat fwrite's performance on things like this - large sequential writes.

提交回复
热议问题