4 ms·
Certainly it depends. One one side, if your input data is read only once or a few times, introducing any intermediate binary format will often not be worth it,
by cnvogel 12y ago
Certainly it depends. One one side, if your input data is read only once or a few times, introducing any intermediate binary format will often not be worth it, and optimizing reading the ASCII is the way to go.
On the other hand, if you have to crunch through huge amounts of locally stored data, try to make most of your binary file-format resemble the in-memory layout as closely as possible. That way you can, with some luck, mmap() your file and just use pointers into the bulk data. Saves at least one level of copying, from the filesystem cache to application heap. Be careful with validation of lengths and offsets, though!