Depending on what OS this is being run in, the video driver will also play a big part in how fast text is written to the display. Sometimes running a console 'full screen' (native text) helps, and other times it makes it worse.dbenham wrote:Without the redirection to nul, the writes to the console are absolutely horrifically slow.
Discussion forum for all Windows batch related topics.
dbenham wrote:I was thinking that the redirection to nul would short circuit the code that writes to the console window, leaving only the printf within FINDSTR itself.
Out of my experiences it seems that the console window will be updated each time a single character cell was changed. The more characters the text to write has, the longer it takes. Furthermore I was never able to write in parallel. (The WinAPI allows to access the screen buffer at a certain position. I tried to write at different places in a multithreaded application but the output was automatically serialized by the OS.)
Of course you're right. The execution of printf (or appropriate other functions or methods) can't be disabled in an already compiled program. Their execution takes some time and thus, increases the runtime of the utility. But if you redirect the out put you don't have the blocking console window anymore.