I am presently working on a C++ project that involves reading in thousands of small (~20kb) text files which are all in ASCII format.
Will I be able to get a significant performance improvement by converting all of the files into Binary before analyzing them?
Converting a string to a number, while not cheap in cpu cycles, is a non-issue. The amount of overhead involved with I/O is always orders of magnitude larger than the conversion. The size of the file is not much of an issue either, a disk supplies 8KB about as fast as 20KB, it all comes out of the same cluster on the same track. Having thousands of files is a big issue, opening a file involves moving the disk reader head and that takes forever.
So focus on whittling down the number of files for a real gain.
There is no real difference between "ASCII" and "Binary" if you're handling text. ASCII is an interpretation of Binary data as text. So, if I understand your question correctly, the answer is no, there is no conversion that is possible and there is no performance improvement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With