0

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.

enter image description here

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.

  • 2
    How about rebooting every once in a while? You have an insane amount of handles open. There’s probably something leaking handles. – Daniel B Jun 19 '18 at 13:40
  • 1
    Are both PCs with Windows 10? I experienced the same with cli tools on Windows in contrast to Linux. I found out that using these tools in a VirtualBox with Linux on a Windows system was faster then using these tools directly on Windows – Thomas Sablik Jun 19 '18 at 13:47
  • @ThomasSablik Both PCs have Windows 10. – Patrick Szalapski Jun 19 '18 at 14:14
  • 1
    So you are saying the factor is about 10. Is it possible, that the other PC is accordingly more performant? SSD vs. HDD, notebook vs. desktop. Something like that. – Thomas Sablik Jun 19 '18 at 14:23
  • 1
    Same thing when running in Safe Mode? Have you tried using sysinternal's Process Monitor? – root Jun 19 '18 at 14:40
0

In the end, it was indeed Symantec Endpoint Protection. Disabling the services doesn't seem to prevent the problem, but the following does. Run this to confirm it ends the problem.

"%ProgramFiles(x86)%\Symantec\Symantec Endpoint Protection\smc.exe" -stop

This, however, leaves me without Symantec Endpoint Protection.

There may be a way to whitelist certain programs with Symantec, but I'm not sure what it is.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.