3 ms·
It is right that converting endianness is faster than reading text, but it still requires more code than calling printf and scanf. I am not into big data really
by ycmbntrthrwaway 11y ago
It is right that converting endianness is faster than reading text, but it still requires more code than calling printf and scanf. I am not into big data really and my program spends most of the time computing instead of reading and writing so 10x speedup in I/O is just not worth it. As I said, HDF5 was an overkill in my case.
- mturmon 11y agoThe OP, and any other file format spec, needs to be able to read/write large numeric datasets. Printf is very poorly suited to this case. Your comment is true for your use case, but it's not really responsive to the technical issue here.
- Dylan16807 11y agofor (i=start; i<end; i++) arr[i] = ntohl(arr[i]); That's not more code than calling printf/scanf.