Find All Filenames NOT Containing a String

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Posts: 362
Joined: 16 Jul 2013 12:00
Location: HSV

Re: Find All Filenames NOT Containing a String

#16 Post by Samir » 23 Jul 2017 15:47

dbenham wrote:Without the redirection to nul, the writes to the console are absolutely horrifically slow.
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.

Posts: 3934
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Find All Filenames NOT Containing a String

#17 Post by aGerman » 24 Jul 2017 01:46

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.


Post Reply