Hi everyone,
I am in the process of improving the PK integrals code. For that, I am measuring the time spent reading file 33, containing integrals in the IWL format. Briefly, the way it is done is:
iwl_buf_init(…)
do {
// Some code here
iwl_buf_fetch(…)
} while(!last_buffer)
iwl_buf_close()
This whole piece of code takes about 7 seconds to execute in the regular code, where I only measure time spent reading and not any of the time spent in [//Some code].
However, if [//Some code] contains write to multiple other files through IWL buffers, like is necessary for a Yoshimine sort, the total reading time jumps to 40 seconds, and sometimes even 70 seconds.
Is there any obvious reason I am missing that reading file 33 should be much slower when we write to multiple other files ?
Do we expect IO caching on the hard drive to have such a drastic effect, or is there some internal caching in the IWL or PSIO libraries ?