Several command-line programs seem a little slow on a PC. How can I troubleshoot? For example, on this PC, It takes over a half-second to run git status
:
PS> for (;;) { Measure-Command { git status } | findstr TotalSeconds }
TotalSeconds : 0.7119173
TotalSeconds : 0.6040415
TotalSeconds : 0.6117674
TotalSeconds : 0.5779911
TotalSeconds : 0.6069439
...
(On another PC, the above runs in 0.05 s.) A few other commands I've noticed take just a bit too long as well:
PS> for (;;) { Measure-Command { node --version } | findstr TotalSeconds }
TotalSeconds : 0.4630501
TotalSeconds : 0.3144418
TotalSeconds : 0.2842615
TotalSeconds : 0.2808537
(The other PC runs that in 0.02 s.)
One more for good measure:
PS> for (;;) { Measure-Command { npm --version } | findstr TotalSeconds }
TotalSeconds : 3.4839123
TotalSeconds : 3.1501913
TotalSeconds : 2.9817682
TotalSeconds : 3.0423125
When these programs are running, I see CPU usage jump up, as if it is pegging 1/4th of the CPU's four cores. The CPU usage is elevated only in the process I invoked itself (i.e. Git.exe or Node.exe), not in any other process.
I have tried disabling as many Windows services as I can, to the point where my PC can barely do anything, yet I still get timings similar to the above. I have ensured that antivirus, firewall, and BeyondTrust are disabled, and the problem persists. I do not have ATI graphics (Intel HD 520 only).
The timings are the same whether I invoke from Powershell, cmd.exe, or bash.
The problem goes away in safe mode.
After booting normally, I've tried stopping all non-essential processes; the slowness persists. I've tried disabling all non-essential Windows services; the slowness persists. I've tried disabling all non-essential hardware in the Device Manager; the slowness persists.
Can anyone suggest a next troubleshooting step? I fear the cause of these issues is also slowing down other apps, as well.