Many processes such as git and node are running 10x too slow on Windows 10, but run fast in safe mode

2

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.

Patrick Szalapski

Posted 2018-06-19T13:11:05.140

Reputation: 197

2How about rebooting every once in a while? You have an insane amount of handles open. There’s probably something leaking handles. – Daniel B – 2018-06-19T13:40:21.130

1Are 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 – 2018-06-19T13:47:33.210

@ThomasSablik Both PCs have Windows 10. – Patrick Szalapski – 2018-06-19T14:14:05.437

@DanielB I rebooted and ran the above again, and got very similar timings. Thanks for the idea. – Patrick Szalapski – 2018-06-19T14:14:33.723

1So 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 – 2018-06-19T14:23:41.533

The systems are similar enough. They both have SSDs, Quad Core i7s, and are both notebooks. I thought, on a command like git status, it wouldn't matter too much? – Patrick Szalapski – 2018-06-19T14:28:46.297

1Same thing when running in Safe Mode? Have you tried using sysinternal's Process Monitor? – root – 2018-06-19T14:40:57.613

I would first run Process Monitor, and consider the modules be loaded (Load Image) by the processes, anything being loaded that isn't required? If so, prevent these modules from loading. – HelpingHand – 2018-06-19T21:03:10.913

I'm not sure what you mean by "modules" or "load image". I see the process tree in SysInternals Process Explorer (not "Monitor"), and it gives me no clues of CPU use except by the process I am running--in the examples above, git.exe and node.exe. – Patrick Szalapski – 2018-06-19T21:17:18.093

@root, things are MUCH MUCH faster in safe mode, which is a good clue. But, having already tried shutting down as many processes and Windows services as I can. Any next step suggestions? – Patrick Szalapski – 2018-06-20T20:16:24.703

I've edited the question to elaborate on what else I've found. – Patrick Szalapski – 2018-06-21T02:59:52.187

You've disabled services, but have you also disabled startup applications? – root – 2018-06-21T19:35:12.593

Yes, I tried that too. – Patrick Szalapski – 2018-06-21T19:56:01.257

Answers

2

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.

EDIT: We subsequently found that the real delay came from Application and Device Control, not the bulk of SEP. This can be disabled in Settings > Client Management > General, at the bottom.

(Even deeper, there seems to be an experimental feature in only part of Application and Device Control that causes a delay on every process start. I am not sure what it is.)

Patrick Szalapski

Posted 2018-06-19T13:11:05.140

Reputation: 197