I am trying to write a large sum of data to a file. Some suggested i should use binary mode but i already have done it in text mode. Is there a big difference in using the binary in terms of speed? What is the advantage or disadvantage in using the binary mode?
Share
In the binary mode the data gets written unchanged. In the text mode, there can be some additional code to handle
'\n'and'\r'(in DOS/Windows'\n'expands into'\r\n'). At any rate, disk speeds are orders of magnitude lower than the RAM speed and I wouldn’t be too much concerned about the mode here, unless, of course, it turns out that caching is different in the two modes.