Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The first step would be to figure out how much of the time is spent in the <code>if(lineIn.find(...)...</code> and how much is the actual reading of input file. </p> <p>Time the time your application runs for (you may want to take a selection of log-files, rather than ALL of them). You may want to run this a few times in a row to see that you get the same (approximately) value. </p> <p>The add:</p> <pre><code>#if 0 if (lineIn.find(...) ...) ... #endif </code></pre> <p>and compare the time it takes. My guess is that it won't actually make that much of a difference. However, if the searching is a major component of the time, you may find that it's beneficial to use a more clever search method. There are some pretty clever methods for searching for strings in a larger string. </p> <p>I will post back with a couple of benchmarks of "read a file quicker" that I've posted elsewhere. But bear in mind that the hard-disk that you are reading from will be the major amount of time. </p> <p>References:</p> <p><a href="https://stackoverflow.com/questions/14463244/getline-while-reading-a-file-vs-reading-whole-file-and-then-splitting-based-on-n">getline while reading a file vs reading whole file and then splitting based on newline character</a></p> <p>slightly less relevant, but perhaps interesting:</p> <p><a href="https://stackoverflow.com/questions/15115943/what-is-the-best-efficient-way-to-read-millions-of-integers-separated-by-lines-f">What is the best efficient way to read millions of integers separated by lines from text file in c++</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload