Quote:
Originally posted by JasonD
The problem is that the test only shows one thing - that it is clearly faster for reading the same file over and over again. This is not a real world situation.
This is a generalization. There are plenty of real world situations that work off of a single file and seek around the file. Most commercial software works off of a single file, and based on my experience (monitoring disk reads) most do not cache the entire file in memory. There is no worse way to waste memory than to cache huge files in memory.
Quote:
Originally posted by JasonD
You say that reading multiple files gets "too elaborate for this purpose", but I believe that reading multiple files (or doing some other method - does anyone else have any ideas?) is the only proper way of testing this. Anything simplier, like the method you have chosen, does not replicate a real world situation.
See Above.
Quote:
Originally posted by JasonD
Your test only shows that if you choose not to cache your files into memory yourself (which is rather foolish, but this information may be of interest to amateur programmers who choose not to do such things)
wasting memory is an amature programmer tendency as well. Seeking around a file is a perfectly legitimate way of doing things. I dare you to write a database app that works any other way!
Quote:
Originally posted by JasonD
, then the win32 api functions are twice as fast as the runtime functions when reading from the same file in the future. Again, the point is that this simply does not happen in real world applications.
real world is something I know my share about. And I have to disagree with you 100%. The norm is most certainly not what you are saying. And even if it were, write a test that does that. I have very little doubt of the results.