Defender's real time protection can significantly slow down disk and IO bound operations on Windows, so if you're doing disk intensive work or stress tests I find turning off Defenders Real Time Protection can improve performance drastically.
The following Powershell script provides a quick way to turn Powershell Real Time protection on and off quickly. Dump this file into a folder on your path to quickly turn.
##################################################
# Turn Defender Real Time Monitoring off
# turns defender real time monitoring -on or -off
# Has to run under an Admin prompt
#
# Syntax:
#
# Defender - turns Monitoring off (default)
# Defender -off - turns Monitoring off
# Defender -on - turns Monitoring on
##################################################
param(
[switch] $on = $false,
[switch] $off = $false
)
$setTo = $true;
if ($on.Equals($true)) {
$setTo = $false
}
if ($off.Equals($true)) {
$setTo = $true
}
Write-Host "Defender Real Time Protection"
if ($setTo.equals( $true)) {
"Set to: Off"
}
else {
"Set to: On"
}
Set-MpPreference -DisableRealtimeMonitoring $setTo
# Delay to let the settings take
Start-Sleep -MilliSeconds 1000
$defenderOptions = Get-MpComputerStatus
if($defenderOptions) {
$setting = "On"
if (-not $defenderOptions.RealTimeProtectionEnabled ) {
$setting = "Off"
}
Write-Host "Actual Setting: " $setting
}
Additional things you should do:
- Create Exclusion Folders in Defender
- Development folders
- Development Tools folders (Visual Studio, MSBuild, Resharper)