file operation in binary vs text mode — performance concern

前端 未结 7 664
执笔经年
执笔经年 2020-12-31 10:04

In many projects, I saw that data object/structure are written into file in binary mode, and then retrieve them back from the file in binary mode again.

I wonder why

7条回答
  •  梦谈多话
    2020-12-31 10:34

    Binary format is more accurate for storing the numbers as they are stored in tha exact internal representation. There are no conversations while saving the data and therefore saving is much faster.

提交回复
热议问题