I have a collection of scripts which call, a couple of thousands times, an external executable. This executable should have a fairly low run time, so this should not a big deal.
But it is.
In fact, due to Windows Defender's real-time protection, execution times just for the help page of said executable are in the order of 550 ms (more than a second for the first call), with the executable being statically linked and just 1 MB in size.
Without Windows Defender real-time projections, execution times are on the order of 20 ms.
One solution to this problem is a dynamically linked version of same executable (50 KB), with execution times of 50 ms (with Windows Defender) and 10 ms (without it). Still, 40 ms times 1000s of times still makes a couple of minutes I would not like to wait if I don't have to.
My idea was to white-list the executable. Is that a safe thing to do? Will taking away write permissions to the executable be helpful? Is there another way to lessen Windows Defender's hit on performance?