Why does Cygwin execute shell commands very slowly?

前端 未结 11 1153
说谎
说谎 2020-12-08 11:29

Just tests a very simple command like:

while true; do bash -c \"echo hello\"; done

You will find how much slow the bash in Cygwin is. Does

11条回答
  •  一整个雨季
    2020-12-08 12:18

    For Windows Defender:

    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender]
    "DisableAntiSpyware"=dword:00000001
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection]
    "DisableBehaviorMonitoring"=dword:00000001
    "DisableOnAccessProtection"=dword:00000001
    "DisableScanOnRealtimeEnable"=dword:00000001
    

    or less dramatically:

    powershell -Command Add-MpPreference -ExclusionPath "C:\opt\cygwin64"
    powershell -Command Add-MpPreference -ExclusionPath "C:\home"
    powershell -Command Add-MpPreference -ExclusionProcess "git.exe"
    powershell -Command Add-MpPreference -ExclusionExtension ".c"
    powershell -Command Add-MpPreference -ExclusionExtension ".cpp"
    powershell -Command Add-MpPreference -ExclusionExtension ".cxx"
    

    For Sophos:

    REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\Sophos Endpoint Defense\Scanning\Config" /v "OnAccessExcludeFilePaths" /t REG_MULTI_SZ /d "C:\Program Files (x86)\Sophos\Sophos Anti-Virus\\0C:\home\\0D:\Video\\" /f
    REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\Sophos Endpoint Defense\Scanning\Config" /v "OnAccessExcludeProcessPaths" /t REG_MULTI_SZ /d "C:\opt\cygwin64\\" /f
    

提交回复
热议问题