Anyone have any knowledge about output calls to the Console affecting the performance of a client thread's code in between
the output calls?
More generally, can you explain if the Console interacts with the client thread? I believe the console is controlled by an instance of csrss.exe, in a different thread. From some event profiling, it appears that the client thread's core has a reduced throughput in handling writes to the data cache.
Here are some details...
I have been running some CPU timing tests, but programs are sometimes running slower than I would have expected. For instance, a large memcpy() takes about 3 cycles per 8 bytes transferred, yet the actual code stores 8 bytes per cycle. memset() takes about 2 cycles per store.
I have also been timing some programs I wrote myself. The timing program will run the target code many times, then print the time and some other information, then go back and repeat all this several times. I noticed that if I called the timing program with an option to not print that other information, just the running time, the running times were remarkably faster!
So those extra outputs through the console were somehow affecting the speed at which subsequent code, with no I/O or system calls, ran.
My timing program sets affinity to a sincle core and elevates itself to High base priority and Realtime thread priority, to give it 100% access to that core.
Years ago I had a similar experience with XP 64-bit. In that case, I found that I got better running times if I would sleep for a few seconds after the last console output before running the next timing test.