Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

2 Pages12>
serious typing lag when running NCrunch in VS2019
offset123
#1 Posted : Tuesday, August 6, 2019 7:20:23 PM(UTC)
Rank: Member

Groups: Registered
Joined: 8/24/2015(UTC)
Posts: 16
Location: Slovenia

Was thanked: 2 time(s) in 2 post(s)
I switched to VS2019 a few days ago and now (for the same solution I was working in VS2017) I'm noticing a serious lag while typing code. The only way to get rid of it was to disable NCrunch. The keyboard lag is so big it makes coding very difficult (it's like working through a double Remote Desktop session). The solution is not that big (10 projects, around 1000 classes max).

I tried disabling Resharper (while leaving NCrunch enabled) and the lag is still there, so I assume it's not caused by Resharper.

Just for fun, I went back to VS2017 and opened the same solution, and there is no noticable lag.

I also tried extending the grace period for NCrunch builds (from 0 to 1 second), but it didn't help.

Remco suggested allocating more cores to VS:

Quote:
We go to crazy levels to keep NCrunch off UI resources, but it could be caused by the IDE not fitting within the allocated number of cores. VS2019 is the hungriest version of VS ever. Have you tried allocating more cores to VS?


which I did (from 4/4 to 2/6, so 6 cores for VS) and the lag is still there, frankly I didn't notice any difference.

The weird thing is I don't see any major CPU utilization during the lag, VS is running around 10% of CPU or less while typing.

My hardware:
- i7-7700 CPU @ 3.60GHz, 3601 Mhz, 4 Core(s)
- 16 GB RAM (but only 60% is used at the moment)
- SSD
Remco
#2 Posted : Tuesday, August 6, 2019 11:11:57 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,788

Thanks: 748 times
Was thanked: 961 time(s) in 916 post(s)
Hi, thanks for sharing this issue.

Let's try and narrow this down further so we can work out where to go from here.
A rather unscientific way we've established for tracking keyboard lag in the IDE is to simply hold down the comment key ('/') for a full line and count how many times it stutters while the line is being drawn in the IDE. Under normal function, there should be no stuttering at all.

See if you can try the following deductions:

- Does the problem appear when NCrunch is running at full speed with all its tool windows closed?
- Does the problem appear when NCrunch is running at full speed with all its tool windows closed and the 'instrument output assembly' setting set to 'False' for your entire solution?
- What if you set NCrunch to the 'Execute tests manually' engine mode so it only runs builds?
- What if you set the 'Max number of processing threads' setting to 1?
- Do you have any other test solution of roughly similar size (3rd party open source is OK) that you can try testing with to see if the problem is specific to your solution?

Other things to check:
- Do you have 'Log Verbosity' set to anything other than 'Summary'?
- Can you check for hidden warnings in the NCrunch Tests Window?
- Are you running any other VS plugins other than NCrunch and ReSharper?
- Are you running an antivirus of any kind? Does disabling it make any difference?
- If you perform the comment key test while you have Windows Task Manager open to the CPU page, do you notice any of the cores becoming fully locked at 100%?
offset123
#3 Posted : Wednesday, August 7, 2019 8:44:35 AM(UTC)
Rank: Member

Groups: Registered
Joined: 8/24/2015(UTC)
Posts: 16
Location: Slovenia

Was thanked: 2 time(s) in 2 post(s)
Hi Remco,

Here are the results. The key takeaway: it has something to do with Windows Defender.

- every '/' is stuttered
- it happens even if all NCrunch windows are closed
- it happens even in 'Execute tests manually' engine mode
- it happens even if 'Max number of processing threads' setting is set to 1
- it happens even if 'instrument output assembly' is set to False for all the solution
- Log Verbosity was set to Summary
- there are no hidden warnings
- I've tried with another solution of the similar size, the lag is there, too
- Extensions installed (some of them come built-in when VS is installed):
-
  • HgSccPackage
    - GhostDoc Community
    - WakaTime
    - Layouts O Rama
    - Editor Guidelines
    - Color Theme Editor
    - Developer Analytics Tools
    - Cloud Explorer
    - Microsoft Library Manager
    - Live Share
    - Visual Studio IntelliCode - I disabled this one and the lag is still there
    - Dotnet Extensions for Test Explorer



- I only have Windows Defender (Windows 10 Pro). When I disable Real-time protection, the is (almost) gone. '/' are almost without lag (maybe one or two '/' in the whole line, but not the first one). It is still a bit less responsive than with NCrunch engine disabled.
- One note about Windows Defender: I have the whole source directory tree excluded from the real time protection (and it's not on the system disk). So it has to be some files somewhere else on the disk.
- CPU usage while slashing: the process with highest usage is devenv, but it only uses 5-7%. Everything else is 1% or below. System idle is around 84-87%
- I have a very similar setup on another machine (new laptop) and the VS2019 lag problem is the same and also disabling Defender real-time protection reduces the lag significantly. Again, it worked without the lag in VS2017.
Der-Albert.com
#6 Posted : Wednesday, August 7, 2019 12:38:49 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/17/2011(UTC)
Posts: 171

Thanks: 8 times
Was thanked: 37 time(s) in 34 post(s)
Can confirm this, NCrunch 3.29 and VS 2019 16.2.1. With NCrunch enabled typing is terrible slow. Did not hat with NCrunch 3.28 (and slightly older VS)
MatthewSteeples
#7 Posted : Wednesday, August 7, 2019 1:36:43 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/28/2014(UTC)
Posts: 89
Location: United Kingdom

Thanks: 5 times
Was thanked: 13 time(s) in 11 post(s)
I've noticed it here too. NCrunch 3.29, VS 2019 16.2.1, Win 10 Pro 1903 / 18362.267

CPU usage of devenv does seem to spike when typing. Disabling NCrunch (from NCrunch's menu) appears to fix this

MatthewSteeples
#4 Posted : Wednesday, August 7, 2019 1:38:49 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/28/2014(UTC)
Posts: 89
Location: United Kingdom

Thanks: 5 times
Was thanked: 13 time(s) in 11 post(s)
offset123;13702 wrote:

- CPU usage while slashing: the process with highest usage is devenv, but it only uses 5-7%. Everything else is 1% or below. System idle is around 84-87%


How many "logical processors" do you have on the computer? With multi-processors being common, the percentage can be quite misleading. If you've got 8, then if a process is shown as using 12% then it actually means it could be using 100% of one processor.
Der-Albert.com
#8 Posted : Wednesday, August 7, 2019 1:43:55 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/17/2011(UTC)
Posts: 171

Thanks: 8 times
Was thanked: 37 time(s) in 34 post(s)
On my machine NCrunch is able to run on two logical core und VS has 6 Cores assigned (Hardware is 4 Cores and Hyperthreading). But currently tests are running on GridNode Servers only, not locally.
michaelkroes
#9 Posted : Wednesday, August 7, 2019 4:08:36 PM(UTC)
Rank: NCrunch Developer

Groups: Registered
Joined: 9/22/2017(UTC)
Posts: 154
Location: Netherlands

Thanks: 69 times
Was thanked: 32 time(s) in 30 post(s)
Hi All,

Thanks for taking the time to report this issue. Sorry for the inconvenience. I've got this reproduced and I will report back once I know more.
offset123
#5 Posted : Wednesday, August 7, 2019 5:27:10 PM(UTC)
Rank: Member

Groups: Registered
Joined: 8/24/2015(UTC)
Posts: 16
Location: Slovenia

Was thanked: 2 time(s) in 2 post(s)
MatthewSteeples;13710 wrote:
offset123;13702 wrote:

- CPU usage while slashing: the process with highest usage is devenv, but it only uses 5-7%. Everything else is 1% or below. System idle is around 84-87%


How many "logical processors" do you have on the computer? With multi-processors being common, the percentage can be quite misleading. If you've got 8, then if a process is shown as using 12% then it actually means it could be using 100% of one processor.


Yes, 8 logical processors. Sounds to me like the Visual Studio UI thread is running at around 50%.
michaelkroes
#10 Posted : Wednesday, August 7, 2019 7:56:05 PM(UTC)
Rank: NCrunch Developer

Groups: Registered
Joined: 9/22/2017(UTC)
Posts: 154
Location: Netherlands

Thanks: 69 times
Was thanked: 32 time(s) in 30 post(s)
Der-Albert.com
#11 Posted : Wednesday, August 7, 2019 8:28:55 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/17/2011(UTC)
Posts: 171

Thanks: 8 times
Was thanked: 37 time(s) in 34 post(s)
Well, with this Version on my actual Solution VS2019 crashes and restarted itself two times. Before i was able to work on the solution. ReSharper is also installed (current EAP). Now I'm trying to do some tests.
Der-Albert.com
#12 Posted : Wednesday, August 7, 2019 9:07:15 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/17/2011(UTC)
Posts: 171

Thanks: 8 times
Was thanked: 37 time(s) in 34 post(s)
Do I need also update the Grid Node. It is transfering files again and again.
Remco
#13 Posted : Thursday, August 8, 2019 1:53:22 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,788

Thanks: 748 times
Was thanked: 961 time(s) in 916 post(s)
Der-Albert.com;13718 wrote:
Do I need also update the Grid Node. It is transfering files again and again.


Yes - Sorry, we changed the hashing system between this dev build and the release one, so grid servers will need to be updated. We're pushing out a fix for this in a big hurry because UI lag issues are considered critical. Can you confirm if the lag issue seems to be gone with the new build?
Remco
#14 Posted : Thursday, August 8, 2019 1:57:53 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,788

Thanks: 748 times
Was thanked: 961 time(s) in 916 post(s)
It's looking like this is caused by a problem on our side ... Sorry about that. We have a large feature incoming that wasn't quite ready for 3.29, so we deactivated it. It turns out the feature has an event trap that somehow still managed to cause problems even though it was deactivated. The good news is that we think the lag/performance issue is now fixed in the build above and hopefully all future builds. The bad news is that we need to do an emergency release of this as soon as everyone here can confirm that the problem is gone.

Regarding Windows Defender, we've noticed this can become intermittently very hungry and take quite a lot of CPU away from the session. Excluding your solution directory from its scanning will likely help a little, but the main area you need to exclude is NCrunch's workspace base path. This is controlled via a configuration setting. If you're using the default, it should be easy to find by right clicking on any of your projects or tests in the Tests Window and going to 'Advanced->Browse to workspace'.
offset123
#15 Posted : Thursday, August 8, 2019 3:53:44 AM(UTC)
Rank: Member

Groups: Registered
Joined: 8/24/2015(UTC)
Posts: 16
Location: Slovenia

Was thanked: 2 time(s) in 2 post(s)
Remco;13720 wrote:
It's looking like this is caused by a problem on our side ... Sorry about that. We have a large feature incoming that wasn't quite ready for 3.29, so we deactivated it. It turns out the feature has an event trap that somehow still managed to cause problems even though it was deactivated. The good news is that we think the lag/performance issue is now fixed in the build above and hopefully all future builds. The bad news is that we need to do an emergency release of this as soon as everyone here can confirm that the problem is gone.

Regarding Windows Defender, we've noticed this can become intermittently very hungry and take quite a lot of CPU away from the session. Excluding your solution directory from its scanning will likely help a little, but the main area you need to exclude is NCrunch's workspace base path. This is controlled via a configuration setting. If you're using the default, it should be easy to find by right clicking on any of your projects or tests in the Tests Window and going to 'Advanced->Browse to workspace'.


I can confirm the 3.30.0.1 version has fixed the lag for me (even with Windows Defender runtime protection enabled), and there were no crashes during the install / VS startup.
And thanks for the Defender tip!
1 user thanked offset123 for this useful post.
Remco on 8/8/2019(UTC)
JoachimB
#16 Posted : Thursday, August 8, 2019 5:40:14 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/10/2018(UTC)
Posts: 1
Location: Austria

Was thanked: 1 time(s) in 1 post(s)
Hello,

Having the same issue, new build 3.30.0.1 seems to have fixed it.
1 user thanked JoachimB for this useful post.
Remco on 8/8/2019(UTC)
Der-Albert.com
#17 Posted : Thursday, August 8, 2019 8:46:53 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/17/2011(UTC)
Posts: 171

Thanks: 8 times
Was thanked: 37 time(s) in 34 post(s)
VS2019 is now not crashing for me anymore, updated everything to the current version. Tests are running locally and on the Grid Node Server. The lag is gone.
2 users thanked Der-Albert.com for this useful post.
Remco on 8/8/2019(UTC), michaelkroes on 8/8/2019(UTC)
NeilMacMullen
#18 Posted : Thursday, August 8, 2019 7:15:07 PM(UTC)
Rank: Member

Groups: Registered
Joined: 12/15/2016(UTC)
Posts: 16
Location: United Kingdom

Thanks: 8 times
Was thanked: 5 time(s) in 5 post(s)
I was just about to post about this bug but saw this thread. The 3.30.0.1 build definitely seems to help massively in getting back to the original performance but I think I can still detect a little lag - particularly noticeable as a slight delay when waiting for the Intellisense window to pop up after pressing '.' (I already had the AppData local workspace excluded from Defender.)
Remco
#19 Posted : Thursday, August 8, 2019 10:50:02 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,788

Thanks: 748 times
Was thanked: 961 time(s) in 916 post(s)
NeilMacMullen;13736 wrote:
I was just about to post about this bug but saw this thread. The 3.30.0.1 build definitely seems to help massively in getting back to the original performance but I think I can still detect a little lag - particularly noticeable as a slight delay when waiting for the Intellisense window to pop up after pressing '.' (I already had the AppData local workspace excluded from Defender.)


Intellisense tends to be quite hungry in general. Can you confirm whether this is better when NCrunch is disabled? If so, we might need to work through the big list of questions earlier in this thread to try and narrow this one down.
Der-Albert.com
#20 Posted : Friday, August 9, 2019 10:08:56 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/17/2011(UTC)
Posts: 171

Thanks: 8 times
Was thanked: 37 time(s) in 34 post(s)
I checked the following, pressing a high amount of keys the same time (asdf and hjkl at the same time with high frequenncy, i know there is key rollover or not depending on the keyboard, but this is the question now ;)) in a comment, so that no intellisense poppt up.

1) I tested with NCrunch disabled, the characters appeared fast on the screen, at least that fast that it it was not possible for me getting faster in pressing keys.

2) I tested with NCrunch enabled, with a capacity of 4 Tasks on my local machine (have 8 logical cores) and two grid nodes, it was still not possible for me to get really faster then pressing the keys but the characters might appear a fraction slower (it tested this back and forth).

3) I tested this with NCrunch enabled, this time with local test running disabled only with the grid nodes enabled, it appearance of characters was as fast as in 1

This is by no mean scientific data ;)
1 user thanked Der-Albert.com for this useful post.
Remco on 8/9/2019(UTC)
Users browsing this topic
Guest
2 Pages12>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.113 seconds.