-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visual Studio constantly consumes ~50 - 90% CPU after opening a large project #2388
Comments
I suspect this only occurs for cross-targeting projects. |
When you say DT builds are processed - what did you mean? Dependencies are processing them when new data comes, if code is still around DT builds are not processed yet.. Or processed and sent tree update requests which could be pending/in progress by tree provider. |
I don't know yet as I haven't dug into the details - but if I leave the project for 20 minutes we're still consuming lots of CPU. |
I'm seeing lots of CPU usage also in Roslyn.sln. |
I'm seeing part of the problem - looks like Test Window is doing a IsDocumentInProject on all projects - which is walking into every single dependency node:
I've got a trace, and trying to interpret it. |
For a 10 second period I'm seeing 400 GCs (362 Gen0, 38 Gen1), that can't be normal... |
The test delay is something else, and being tracked by another bug. I spent more time looking into - it looks like we're constantly getting called back with "project changes" in CrossTargetRuleSubscriberBase.OnProjectChangedAsync. |
Looks like for each ConfiguredProject, we have 6 design-time subscription links, and 6 evaluation subscriptions link, that probably doesn't help. |
Yeah, that 6 subscriptions should be halved because we're sync'ing to the catalog source, but basically, looks like we're adding too many subscriptions - now to figure that out. |
The subscriptions were a red herring, they are expected, as we subscribe to 2 things per configuration. The real issue is that we're continuously resetting subscriptions. The underlying reason is because we're expecting a user written value ("TargetFramework") to be canonical, from our guidelines:
The end result is that we're comparing:
against:
And this fails. |
Fixed by #2526 |
This was the root cause behind dotnet/project-system#2388
Fixes: #2388. We were making the assumption that the literal user written short name, matched the canonical version of the short name. This wasn't the case: The project file had: portable-net4+win8+wpa81 Our "canonical" version had: portable-net40+win8+wpa81 This was causing us to continually reset our subscriptions to the data flow, and constantly process the same data over and over again. After my fix, we still do not handle the portable versions correctly in the project, in that we only show one of them in the dependencies tree, filed #2524 to track that. Note also that this code shouldn't even be looking at TFMs, filed: #2525 to track that.
I have VS 2017.3 Preview 3 showing the same symptoms, but I wouldn't consider it the big a large project; 1 project with approx. 30 bower packages ? very little in the way of C# code. |
After fixing: #2383 which makes VS much more responsive - but Visual Studio still consumes 50% - 90% CPU after opening a large project.
Expected: After init has finished and we've processed design-time builds for CPU to be around or close to 0%.
Actual: CPU is constantly pegged for 50% - 90%, looking at dumps lots of dependency node code still runnning.
The text was updated successfully, but these errors were encountered: