
Speeding up WSL I/O up to 5x faster - laktak
https://medium.com/@leandrw/speeding-up-wsl-i-o-up-than-5x-fast-saving-a-lot-of-battery-life-cpu-usage-c3537dd03c74
======
Sujan
I have a shortcut on my desktop that toggles Real Time Protection:

Create a file `toggle-defender-real-time-protection.ps1` in a known location
with the following content:

    
    
      $preferences = Get-MpPreference
      Set-MpPreference -DisableRealtimeMonitoring (!$preferences.DisableRealtimeMonitoring)
    

Then create a shortcut for this target:

    
    
      %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "toggle-defender-real-time-protection.ps1"
    

Make it run as Administrator.

(Source of this nice script:
[https://superuser.com/a/1287788/25933](https://superuser.com/a/1287788/25933))

Note that Windows somehow turns the protection on after a random amount of
time.

------
earenndil
Antivirus is not very useful. A little common sense goes a lot farther.
Whenever I use windows, I disable the AV entirely.

------
llampx
Thanks for these tips. Real-time protection seems to be responsible for my
laptop pegging itself at 100% CPU for a few minutes every time I wake it up
from sleep, I will see if this changes anything.

------
Someone1234
This also helps Visual Studio.

I'd definitely just add exclusions though, rather than disabling it entirely.

~~~
tanseydavid
I was never able to get it work using folder exclusions or application
exclusions.

Turning off REALTIME protection is the only thing I am to use to get relief
from this problem.

------
laktak
Also add any processes you frequently use to the exclusion (like python3.5 for
ranger).

------
writepub
But why don't we deserve both speed and security, at the same time?

------
omgtehlion
TL;DR: disable win defender.

Anyways, this is the first thing I do on a dev machine. Usually I remove any
A/V completely, not just disable it. Because top of the line core-i7 machine
with all "security" features enabled works no faster than venerable 486dx.

